Files
sundynix-radio-be/model/system/sys_user.go
T
2026-03-05 16:54:25 +08:00

46 lines
1.8 KiB
Go

package system
import (
"sundynix-go/global"
"time"
)
type Login interface {
GetAccount() string
GetUserId() string
GetUserInfo() any
}
type User struct {
global.BaseModel
TenantId string `gorm:"size:20;" json:"tenantId" form:"tenantId"`
ClientId string `gorm:"size:20;" json:"clientId"`
Name string `gorm:"size:20" json:"name" form:"name"`
Account string `gorm:"size:11;" json:"account" form:"account"`
Password string `gorm:"size:100;" json:"-" form:"password"`
NickName string `gorm:"size:20;column:nick_name" json:"nickName" form:"nickName"`
Phone string `gorm:"size:20;column:phone" json:"phone" form:"phone"`
SessionKey string `gorm:"size:80;column:session_key" json:"sessionKey" form:"sessionKey"`
UnionId string `gorm:"size:80;column:union_id" json:"unionId"`
OpenId string `gorm:"size:80;column:open_id" json:"openId" form:"openId"`
AvatarId string `gorm:"size:50;column:avatar_id" json:"avatarId"`
Avatar *Oss `gorm:"foreignKey:AvatarId" json:"avatar"`
Gender int `gorm:"default:0" json:"gender"` // 性别 0:未知 1:男 2:女
Country string `gorm:"size:50" json:"country"` // 国家
Province string `gorm:"size:50" json:"province"` // 省份
City string `gorm:"size:50" json:"city"` // 城市
Language string `gorm:"size:20" json:"language"` // 语言
IsVip int `gorm:"default:0" json:"isVip"` // 是否VIP 0:否 1:是
VipExpireAt *time.Time `gorm:"column:vip_expire_at" json:"vipExpireAt"` // VIP过期时间
}
func (u *User) GetAccount() string {
return u.Account
}
func (u *User) GetUserId() string {
return u.Id
}
func (u *User) GetUserInfo() any {
return *u
}