95 lines
2.5 KiB
Go
95 lines
2.5 KiB
Go
package model
|
||
|
||
import (
|
||
"time"
|
||
|
||
"github.com/gogf/gf/v2/os/gtime"
|
||
)
|
||
|
||
// User 用户信息
|
||
type User struct {
|
||
Id int64 `json:"id" orm:"id,primary"` // 用户ID
|
||
Username string `json:"username" orm:"username,not null"` // 用户名
|
||
PasswordHash string `json:"passwordHash" orm:"password_hash,not null"` // 密码哈希
|
||
Nickname string `json:"nickname" orm:"nickname"` // 昵称
|
||
Avatar string `json:"avatar" orm:"avatar"` // 头像
|
||
Phone string `json:"phone" orm:"phone"` // 手机号
|
||
Email string `json:"email" orm:"email"` // 邮箱
|
||
Gender int `json:"gender" orm:"gender,default:0"` // 性别:0=未知,1=男,2=女
|
||
Birthday *gtime.Time `json:"birthday" orm:"birthday"` // 生日
|
||
Status int `json:"status" orm:"status,default:1"` // 状态:1=正常,2=禁用
|
||
LastLoginAt *gtime.Time `json:"lastLoginAt" orm:"last_login_at"` // 最后登录时间
|
||
LastLoginIp string `json:"lastLoginIp" orm:"last_login_ip"` // 最后登录IP
|
||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at"` // 创建时间
|
||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at"` // 更新时间
|
||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at"` // 软删除时间戳
|
||
}
|
||
|
||
// UserCreateIn 创建用户请求
|
||
type UserCreateIn struct {
|
||
Username string
|
||
Password string
|
||
Nickname string
|
||
Avatar string
|
||
Phone string
|
||
Email string
|
||
Gender int
|
||
Birthday *gtime.Time
|
||
}
|
||
|
||
// UserUpdateIn 更新用户请求
|
||
type UserUpdateIn struct {
|
||
Id int64
|
||
Nickname string
|
||
Avatar string
|
||
Phone string
|
||
Email string
|
||
Gender int
|
||
Birthday *gtime.Time
|
||
Status int
|
||
}
|
||
|
||
type LoginCache struct {
|
||
Token string `json:"token"`
|
||
Status int `json:"status" dc:"0-准备扫码,1-已扫码"`
|
||
CreatedAt time.Time `json:"created_at"`
|
||
}
|
||
|
||
type UserLoginIn struct {
|
||
OpenId string
|
||
}
|
||
type UserLoginOut struct {
|
||
Token string
|
||
}
|
||
|
||
type UserInfoIn struct {
|
||
Id int
|
||
OpenId string
|
||
}
|
||
type UserInfoOut struct {
|
||
Id int64
|
||
}
|
||
|
||
type UserBindPhoneIn struct {
|
||
}
|
||
|
||
type UserListIn struct {
|
||
OperatorId int64
|
||
Role string
|
||
Nickname string
|
||
Page int
|
||
Size int
|
||
}
|
||
type UserListOut struct {
|
||
List []User
|
||
Total int
|
||
}
|
||
|
||
type UserCodeIn struct {
|
||
UserId int // 绑定手机号时需要使用该字段
|
||
Phone string
|
||
}
|
||
|
||
type UserCodeOut struct {
|
||
}
|