2022-10-09 02:15:25 +02:00
|
|
|
package models
|
|
|
|
|
|
|
|
import "go.mongodb.org/mongo-driver/bson/primitive"
|
|
|
|
|
|
|
|
type User struct {
|
2022-10-21 03:04:28 +02:00
|
|
|
Id primitive.ObjectID `bson:"_id" json:"id", omitempty`
|
|
|
|
Banned bool `bson:"banned" json:"banned"`
|
|
|
|
BlackLister bool `bson:"blacklisted" json:"blacklisted"`
|
|
|
|
Experience uint `bson:"experience" json:"experience"`
|
2022-10-09 02:15:25 +02:00
|
|
|
//LastBuy string `bson:"lastBuy,omitempty"`
|
2022-10-21 03:04:28 +02:00
|
|
|
Level uint `bson:"level" json:"level"`
|
|
|
|
Money uint `bson:"money" json:"money"`
|
|
|
|
MoneyLimit uint `bson:"moneyLimit" json:"moneylimit"`
|
2022-10-21 20:09:10 +02:00
|
|
|
DiscordId string `bson:"userId" json:"discordid"`
|
|
|
|
SteamId string `bson:"steamId" json:"steamid"`
|
2022-10-21 03:04:28 +02:00
|
|
|
DiscordName string `bson:"username,omitempty" json:"discordname"`
|
2022-10-09 02:15:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewUser() *User {
|
|
|
|
return &User{primitive.NewObjectID(), false, false, 0, 0, 0, 0, "", "", ""}
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewUserDiscord(id string, name string) *User {
|
|
|
|
ret := NewUser()
|
|
|
|
ret.DiscordId = id
|
|
|
|
ret.DiscordName = name
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewUserSteam(id string) *User {
|
|
|
|
ret := NewUser()
|
|
|
|
ret.SteamId = id
|
|
|
|
return ret
|
|
|
|
}
|