This commit is contained in:
2025-04-07 11:21:43 +08:00
parent 51a888e470
commit f100427f8b
11 changed files with 350 additions and 26 deletions

View File

@@ -0,0 +1,40 @@
package system
import (
"time"
"github.com/google/uuid"
)
type User struct {
ID int32 `json:"id" gorm:"primaryKey"`
Uuid uuid.UUID `json:"uuid"`
// 邮箱地址
Email string `json:"email"`
// 用户名称
Username string `json:"username"`
// 加密密码
HashedPassword []byte `json:"hashed_password"`
// 密码盐值
Salt string `json:"salt"`
// 头像
Avatar string `json:"avatar"`
// 性别
Gender int32 `json:"gender"`
// 部门
DepartmentID int32 `json:"department_id"`
// 角色
RoleID int32 `json:"role_id"`
// 状态
Status int32 `json:"status"`
// 密码修改时间
ChangePasswordAt time.Time `json:"change_password_at"`
// 创建时间
CreatedAt time.Time `json:"created_at"`
// 更新时间
UpdatedAt time.Time `json:"updated_at"`
}
func (User) TableName() string {
return "sys_user"
}