package model import "wireguard-ui/global/constant" type User struct { Base Account string `json:"account" gorm:"type:varchar(50);not null;index:idx_account;comment: '登陆账号'"` Password string `json:"password" gorm:"type:varchar(255);not null;comment: '密码'"` Nickname string `json:"nickname" gorm:"type:varchar(50);not null;comment: '昵称'"` Avatar string `json:"avatar" gorm:"type:varchar(255);not null;comment: '头像'"` Contact string `json:"contact" gorm:"type:varchar(255);default null;comment: '联系方式(邮箱|电话)'"` IsAdmin constant.UserType `json:"isAdmin" gorm:"type:tinyint(1);not null;comment: '是否为管理员(0 - 否 | 1 - 是)'"` Status constant.Status `json:"status" gorm:"type:tinyint(1);not null;comment: '用户状态(0 - 否 | 1 - 是)'"` } func (User) TableName() string { return "t_user" }