feat: sale add create user

This commit is contained in:
zzw
2026-09-02 09:47:34 +08:00
parent ad4bc7de85
commit 540f74f9b7
39 changed files with 2023 additions and 282 deletions
+23 -93
View File
@@ -2,107 +2,37 @@ package dao
import "lone-services/pkg/utils"
// UserRow 主用户(表 users
type UserRow struct {
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
Mobile string `gorm:"column:mobile" json:"mobile"`
Name string `gorm:"column:name" json:"name"`
Avatar string `gorm:"column:avatar" json:"avatar"`
Gender uint8 `gorm:"column:gender" json:"gender"`
Birthday utils.CustomTime `gorm:"column:birthday;type:date" 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"`
}
// UserCreate 新建用户
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"`
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
Mobile string `gorm:"column:mobile" json:"mobile"`
Name string `gorm:"column:name" json:"name"`
Avatar string `gorm:"column:avatar" json:"avatar"`
Gender uint8 `gorm:"column:gender" json:"gender"`
Birthday utils.CustomTime `gorm:"column:birthday;type:date" json:"birthday"`
Status uint8 `gorm:"column:status" json:"status"`
}
type UserListItem struct {
Id int64 `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Name string `json:"name"`
HeadPortrait string `json:"head_portrait"`
Mobile string `json:"mobile"`
OriginMobile string `json:"origin_mobile"`
OnTrialNum int `json:"on_trial_num"`
Gender int `json:"gender"`
Gender uint8 `json:"gender"`
Birthday string `json:"birthday"`
Status uint8 `json:"status"`
CreatedAt utils.CustomTime `json:"created_at"`