:new:初始化脚本以及一些工具类

This commit is contained in:
coward
2024-03-06 16:24:49 +08:00
parent a9333df157
commit 7fd186d298
15 changed files with 500 additions and 11 deletions

19
model/entity/user.go Normal file
View File

@@ -0,0 +1,19 @@
package entity
import "wireguard-dashboard/constant"
// User
// @description: 用户信息
type User struct {
Base
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:'是否为管理员'"`
}
func (*User) TableName() string {
return "t_user"
}