Files
arenax-server/internal/model/user.go

197 lines
4.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"github.com/gogf/gf/v2/frame/g"
"time"
"github.com/gogf/gf/v2/os/gtime"
)
// User 用户信息
type User struct {
g.Meta `orm:"table:users"`
Id int64 `json:"id" orm:"id,primary"` // 用户ID
Username string `json:"username" orm:"username,not null"` // 用户名
Nickname string `json:"nickname" orm:"nickname"` // 昵称
Avatar string `json:"avatar" orm:"avatar"` // 头像
Phone string `json:"phone" orm:"phone_number"` // 手机号
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
LastLoginStoreId int `json:"lastLoginStoreId" orm:"last_login_store_id"` // 最后登录门店ID
LastLoginStoreName string `json:"lastLoginStoreName" orm:"last_login_store_name"` // 最后登录门店名称
FirstVisitAt *gtime.Time `json:"firstVisitAt" orm:"first_visit_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
StoreCode string // 门店编码,登录时根据门店编码查询,填写最近一次登录门店 id
}
type WeChatLogin struct {
UUID string // 使用的是微信的唯一 id而不是openid保证微信服务号小程序绑定的系统用户为同一个
}
type WeChatLoginOut struct {
Token string
}
type UserLoginOut struct {
Token string
}
type UserInfoIn struct {
Id int
//OpenId string
}
type UserInfoOut struct {
Id int64
WxOpenId string
Username string
Nickname string
Avatar string
Email string
PhoneNumber string
WxPopenId string
QQPopenId string
RoleId int64
}
type UserBindPhoneIn struct {
Id int64
Phone string
PhoneCode string
}
type UserBindPhoneOut struct {
Success bool
}
type UserListIn struct {
OperatorId int64
OperatorRole string
Nickname string
Page int
Size int
}
type UserListOut struct {
List []User
Total int
}
type UserCodeIn struct {
UserId int // 绑定手机号时需要使用该字段
Phone string
}
type UserCodeOut struct {
}
type UserUpdateImgIn struct {
Id int64
Nickname string
Avatar string
}
type UserUpdateImgOut struct {
Success bool
}
type GetPhoneCodeIn struct {
Id int64
Phone string
}
type GetPhoneCodeOut struct {
Success bool
}
type UserGamelifeCache struct {
Aes string `json:"aes"`
IV string `json:"iv"`
Token string `json:"token"`
Params string `json:"params"`
}
type UserBoundResult struct {
Result bool `json:"result"`
Nick string `json:"nick"`
Ctime uint32 `json:"ctime"`
Utype int8 `json:"utype"`
AppNames []string `json:"app_names"`
}
type UserBoundUrlIn struct {
PopenId string
BindType int
AppName string
Nickname string
IsBound bool
}
type UserBoundUrlOut struct {
Url string
}
type UserUnBoundUrlOut struct {
Url string
}
type UserBoundInfoIn struct {
PopenId string
BindType int
AppName string
}
type UserBoundInfoOut struct {
IsBound bool
AppNames []string
Ctime uint32
Nick string
Utype int8
}
type DelUserIn struct {
Id int64
}
type DelUserOut struct {
Success bool
}
type GetUserGameRoleIn struct {
PopenId string
GameId int
BindType int
Area int
}
type GetUserGameRoleOut struct {
RoleList []UserRole
}