2024-03-06 16:24:49 +08:00
|
|
|
|
package entity
|
|
|
|
|
|
|
|
|
|
import "wireguard-dashboard/constant"
|
|
|
|
|
|
|
|
|
|
// User
|
|
|
|
|
// @description: 用户信息
|
|
|
|
|
type User struct {
|
|
|
|
|
Base
|
2024-03-07 11:03:46 +08:00
|
|
|
|
Avatar string `json:"avatar" gorm:"type:varchar(255);not null;comment:'头像'"`
|
|
|
|
|
Name string `json:"name" gorm:"type:varchar(50);not null;comment:'用户名'"`
|
|
|
|
|
Account string `json:"account" gorm:"type:varchar(50);not null;comment:'账号'"`
|
|
|
|
|
Email string `json:"email" gorm:"type:varchar(255);default null;comment:'联系邮箱'"`
|
|
|
|
|
Password string `json:"password" gorm:"type:varchar(255);not null;comment:'密码'"`
|
|
|
|
|
IsAdmin constant.UserType `json:"isAdmin" gorm:"type:int(1);not null;comment:'是否为管理员'"`
|
2024-03-07 15:11:29 +08:00
|
|
|
|
Status constant.UserStatus `json:"status" gorm:"type:tinyint(1);not null;comment:'用户状态(0 - 禁用 | 1 - 正常)'"`
|
2024-03-06 16:24:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (*User) TableName() string {
|
|
|
|
|
return "t_user"
|
|
|
|
|
}
|