model

package
v0.0.0-...-29dd74c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gender

type Gender int
const (
	GenderUnknown Gender = iota // 未知
	GenderMale                  // 男性
	GenderFemale                // 女性
)

type Mail

type Mail struct {
	ID       primitive.ObjectID `bson:"_id" gen:"autoFill"`       // 邮件ID
	Title    string             `bson:"title"`                    // 邮件标题
	Content  string             `bson:"content"`                  // 邮件内容
	Sender   int64              `bson:"sender"`                   // 邮件发送者
	Receiver int64              `bson:"receiver"`                 // 邮件接受者
	Status   int                `bson:"status"`                   // 邮件状态
	SendTime primitive.DateTime `bson:"send_time" gen:"autoFill"` // 发送时间
}

type Status

type Status int

Status 用户状态

const (
	StatusNormal    Status = iota // 正常
	StatusForbidden               // 封禁
)

type ThirdPlatforms

type ThirdPlatforms struct {
	Wechat   string `bson:"wechat"`   // 微信登录openid
	Google   string `bson:"google"`   // 谷歌登录userid
	Facebook string `bson:"facebook"` // 脸书登录userid
}

ThirdPlatforms 第三方平台

type Type

type Type int

Type 用户类型

const (
	TypeRobot   Type = 0 // 机器人用户
	TypeGuest   Type = 1 // 游客用户
	TypeGeneral Type = 2 // 普通用户
	TypeSystem  Type = 3 // 系统用户
)

type User

type User struct {
	ID             primitive.ObjectID `bson:"_id" gen:"autoFill"`
	UID            int32              `bson:"uid" gen:"autoIncr:uid"`         // 用户ID
	Account        string             `bson:"account"`                        // 用户账号
	Password       string             `bson:"password"`                       // 用户密码
	Salt           string             `bson:"salt"`                           // 密码
	Mobile         string             `bson:"mobile"`                         // 用户手机
	Email          string             `bson:"email"`                          // 用户邮箱
	Nickname       string             `bson:"nickname"`                       // 用户昵称
	Signature      string             `bson:"signature"`                      // 用户签名
	Gender         Gender             `bson:"gender"`                         // 用户性别
	Level          int                `bson:"level"`                          // 用户等级
	Experience     int                `bson:"experience"`                     // 用户经验
	Coin           int                `bson:"coin"`                           // 用户金币
	Type           Type               `bson:"type"`                           // 用户类型
	Status         Status             `bson:"status"`                         // 用户状态
	DeviceID       string             `bson:"device_id"`                      // 设备ID
	ThirdPlatforms ThirdPlatforms     `bson:"third_platforms"`                // 第三方平台
	RegisterIP     string             `bson:"register_ip"`                    // 注册IP
	RegisterTime   primitive.DateTime `bson:"register_time" gen:"autoFill"`   // 注册时间
	LastLoginIP    string             `bson:"last_login_ip"`                  // 最近登录IP
	LastLoginTime  primitive.DateTime `bson:"last_login_time" gen:"autoFill"` // 最近登录时间
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL