116 lines
4.9 KiB
Go
116 lines
4.9 KiB
Go
package dao
|
|
|
|
import "lone-services/pkg/utils"
|
|
|
|
type UserCreate struct {
|
|
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
|
Openid string `gorm:"column:openid" json:"openid"`
|
|
Username string `gorm:"column:username" json:"username"`
|
|
Nickname string `gorm:"column:nickname" json:"nickname"`
|
|
Avatar string `gorm:"column:avatar" json:"avatar"`
|
|
Mobile string `gorm:"column:mobile" json:"mobile"`
|
|
Gender uint8 `gorm:"column:gender" json:"gender"`
|
|
Birthday string `gorm:"column:birthday" json:"birthday"`
|
|
AppId uint32 `gorm:"column:app_id" json:"app_id"`
|
|
Status uint8 `gorm:"column:status" json:"status"`
|
|
IsRegistered uint8 `gorm:"column:is_registered" json:"is_registered"`
|
|
IsFaceVerified uint8 `gorm:"column:is_face_verified" json:"is_face_verified"`
|
|
IsProfileCompleted uint8 `gorm:"column:is_profile_completed" json:"is_profile_completed"`
|
|
OnTrialNum int `gorm:"column:on_trial_num" json:"on_trial_num"`
|
|
}
|
|
|
|
type UserCreateByPwd struct {
|
|
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
|
Type uint8 `gorm:"column:type" json:"type"`
|
|
Account string `gorm:"column:account" json:"account"`
|
|
Password string `gorm:"column:password" json:"password"`
|
|
Salt string `gorm:"column:salt" json:"salt"`
|
|
Mobile string `gorm:"column:mobile" json:"mobile"`
|
|
AppId uint32 `gorm:"column:app_id" json:"app_id"`
|
|
Status uint8 `gorm:"column:status" json:"status"`
|
|
IsRegistered uint8 `gorm:"column:is_registered" json:"is_registered"`
|
|
IsFaceVerified uint8 `gorm:"column:is_face_verified" json:"is_face_verified"`
|
|
IsProfileCompleted uint8 `gorm:"column:is_profile_completed" json:"is_profile_completed"`
|
|
OnTrialNum int `gorm:"column:on_trial_num" json:"on_trial_num"`
|
|
}
|
|
|
|
type UserExist struct {
|
|
Id int64 `gorm:"column:id" json:"id"`
|
|
}
|
|
|
|
type UserInfo struct {
|
|
Id int64 `gorm:"column:id" json:"id"`
|
|
Openid string `gorm:"column:openid" json:"openid"`
|
|
Username string `gorm:"column:username" json:"username"`
|
|
Nickname string `gorm:"column:nickname" json:"nickname"`
|
|
Avatar string `gorm:"column:avatar" json:"avatar"`
|
|
Mobile string `gorm:"column:mobile" json:"mobile"`
|
|
Gender uint8 `gorm:"column:gender" json:"gender"`
|
|
Birthday string `gorm:"column:birthday" json:"birthday"`
|
|
Type uint8 `gorm:"column:type" json:"type"`
|
|
Account string `gorm:"column:account" json:"account"`
|
|
AppId uint32 `gorm:"column:app_id" json:"app_id"`
|
|
Status uint8 `gorm:"column:status" json:"status"`
|
|
}
|
|
|
|
type UserLoginRow struct {
|
|
UserInfo
|
|
Salt string `gorm:"column:salt" json:"-"`
|
|
Password string `gorm:"column:password" json:"-"`
|
|
}
|
|
|
|
type Token struct {
|
|
Token string `json:"token"`
|
|
Refresh string `json:"refresh"`
|
|
Info UserLoginSession `json:"info"`
|
|
}
|
|
|
|
type UserLoginSession struct {
|
|
Id int64 `json:"id"`
|
|
Openid string `json:"openid"`
|
|
Username string `json:"username"`
|
|
Nickname string `json:"nickname"`
|
|
Avatar string `json:"avatar"`
|
|
Mobile string `json:"mobile"`
|
|
Gender uint8 `json:"gender"`
|
|
Birthday string `json:"birthday"`
|
|
Type uint8 `json:"type"`
|
|
Account string `json:"account"`
|
|
AppId uint32 `json:"app_id"`
|
|
LastTime utils.CustomTime `json:"last_time"`
|
|
}
|
|
|
|
type UserListRow struct {
|
|
Id int64 `gorm:"column:id" json:"id"`
|
|
Username string `gorm:"column:username" json:"username"`
|
|
Nickname string `gorm:"column:nickname" json:"nickname"`
|
|
Avatar string `gorm:"column:avatar" json:"avatar"`
|
|
Mobile string `gorm:"column:mobile" json:"mobile"`
|
|
OnTrialNum int `gorm:"column:on_trial_num" json:"on_trial_num"`
|
|
Gender int `gorm:"column:gender" json:"gender"`
|
|
Birthday string `gorm:"column:birthday" json:"birthday"`
|
|
Status uint8 `gorm:"column:status" json:"status"`
|
|
CreatedAt utils.CustomTime `gorm:"column:created_at" json:"created_at"`
|
|
UpdatedAt utils.CustomTime `gorm:"column:updated_at" json:"updated_at"`
|
|
}
|
|
|
|
type UserListItem struct {
|
|
Id int64 `json:"id"`
|
|
Username string `json:"username"`
|
|
Nickname string `json:"nickname"`
|
|
HeadPortrait string `json:"head_portrait"`
|
|
Mobile string `json:"mobile"`
|
|
OriginMobile string `json:"origin_mobile"`
|
|
OnTrialNum int `json:"on_trial_num"`
|
|
Gender int `json:"gender"`
|
|
Birthday string `json:"birthday"`
|
|
Status uint8 `json:"status"`
|
|
CreatedAt utils.CustomTime `json:"created_at"`
|
|
UpdatedAt utils.CustomTime `json:"updated_at"`
|
|
}
|
|
|
|
type UserItemsData struct {
|
|
Count int64 `json:"count"`
|
|
Items []UserListItem `json:"items"`
|
|
}
|