59 lines
1.5 KiB
Go
59 lines
1.5 KiB
Go
package model
|
||
|
||
import "github.com/gogf/gf/v2/frame/g"
|
||
|
||
// Admin 管理员信息
|
||
type Admin struct {
|
||
g.Meta `orm:"table:admins"`
|
||
Id int64 `json:"id" orm:"id,primary"` // 管理员ID
|
||
RoleId int64 `json:"roleId" orm:"role_id,not null"` // 角色ID
|
||
Username string `json:"username" orm:"username,not null"` // 管理员用户名
|
||
PasswordHash string `json:"passwordHash" orm:"password_hash,not null"` // 密码哈希
|
||
RealName string `json:"realName" orm:"real_name"` // 真实姓名
|
||
Phone string `json:"phone" orm:"phone"` // 手机号
|
||
Email string `json:"email" orm:"email"` // 邮箱
|
||
Status int `json:"status" orm:"status,default:1"` // 状态:1=正常,2=禁用
|
||
}
|
||
|
||
// AdminCreateIn 创建管理员请求
|
||
type AdminCreateIn struct {
|
||
RoleId int64
|
||
Username string
|
||
Password string
|
||
RealName string
|
||
Phone string
|
||
Email string
|
||
Status int
|
||
}
|
||
|
||
// AdminUpdateIn 更新管理员请求
|
||
type AdminUpdateIn struct {
|
||
Id int64
|
||
RoleId int64
|
||
RealName string
|
||
Phone string
|
||
Email string
|
||
Status int
|
||
}
|
||
|
||
// AdminOut 管理员响应
|
||
type AdminOut struct {
|
||
*Admin
|
||
}
|
||
|
||
type AdminLoginIn struct {
|
||
Username string
|
||
Password string
|
||
}
|
||
type AdminInfoIn struct {
|
||
Id int64
|
||
}
|
||
type AdminInfoOut struct {
|
||
Id int64
|
||
Username string
|
||
PasswordHash string
|
||
RealName string
|
||
Phone string
|
||
Email string
|
||
}
|