You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
3.9 KiB

// 自动生成模板User
package model
import (
"shop-api/global"
"shop-api/model/request"
"time"
uuid "github.com/satori/go.uuid"
)
// 如果含有time.Time 请自行import time包
type User struct {
global.MG_MODEL
UUID uuid.UUID `gorm:"unique;size:64" json:"uuid"` //用户uuid编码
Username string `gorm:"size:128" json:"username"` //用户登录名
NickName string `gorm:"size:20" json:"nick_name"` //昵称
Avatar string `gorm:"size:255" json:"avatar"` //头像
Platform string `gorm:"type:text" json:"platform"` //json格式的平台信息
Appid string `json:"appid" form:"appid" gorm:"size:255"` //用户所属应用
Organization string `json:"organization" form:"organization" gorm:"size:255"` //用户所属组织
Type string `json:"type" form:"type" gorm:"size:255"` //用户类型(随用户所属而定)
Phone string `json:"phone" form:"phone" gorm:"size:255"` //用户手机号
CountryCode string `json:"country_code" form:"country_code" gorm:"size:255"` //用户手机号国家代码
Email string `json:"email" form:"email" gorm:"size:255"` //用户邮箱
Password string `json:"password" form:"password" gorm:"size:255"` //用户密码
PasswordSalt string `json:"password_salt" form:"password_salt" gorm:"size:255"` //用户密码盐
Tags string `gorm:"type:text" json:"tags"` //个人标签
Facebook string `gorm:"size:255" json:"facebook"` //facebook
Douyin string `gorm:"size:255" json:"douyin"` //抖音
Tiktok string `gorm:"size:255" json:"tiktok"` //tiktok
Instagram string `gorm:"size:255" json:"instagram"` //instagram
Twitter string `gorm:"size:255" json:"twitter"` //twitter
Google string `gorm:"size:255" json:"google"` //google
Youtube string `gorm:"size:255" json:"youtube"` //youtube
Ios string `gorm:"size:255" json:"ios"` //ios
IsAuth bool `gorm:"default:0" json:"is_auth"` //是否认证 0未认证 1已认证
IDForbidden bool `json:"id_forbidden"` //是否禁用
ForbiddenTime *time.Time `json:"forbidden_time"` //禁用时间
ForbiddenReason string `json:"forbidden_reason"` //禁用原因
ForbiddenOperation string `json:"forbidden_operation"` //禁用操作人
Jwt string `gorm:"type:text" json:"jwt"` //最后登录jwt
Source string `json:"source" gorm:"size:255"` //用户来源
}
type UserSimple struct {
UUID uuid.UUID `gorm:"unique;size:64" json:"uuid"` //用户uuid编码
NickName string `gorm:"size:20" json:"nick_name"` //昵称
Avatar string `gorm:"size:255" json:"avatar"` //头像
Platform string `json:"-"` //json格式的平台信息
Tags string `gorm:"type:text" json:"tags"` //个人标签
Platforms []request.Platform `json:"platform"` //平台
}
func (User) TableName() string {
return "user"
}
func (UserSimple) TableName() string {
return "user"
}