This commit is contained in:
aozhiwei 2024-11-15 15:21:23 +08:00
parent 3f56768855
commit 68f6653cbf
4 changed files with 10 additions and 0 deletions

View File

@ -64,6 +64,7 @@ CREATE TABLE `t_user` (
`avatar` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'avatar',
`nickname` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'nickname',
`invited` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'invited',
`ext` varchar(255) CHARACTER SET utf8 COMMENT 'ext',
`plat` int(11) NOT NULL DEFAULT '0' COMMENT 'plat',
`plat_vip` int(11) NOT NULL DEFAULT '0' COMMENT 'plat_vip',
`score` bigint(11) NOT NULL DEFAULT '0' COMMENT 'score',
@ -72,6 +73,7 @@ CREATE TABLE `t_user` (
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
UNIQUE KEY `uk_account_id` (`account_id`),
KEY (`openid`)
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

View File

@ -12,6 +12,7 @@ type JwtUserInfo struct {
Plat int32 `json:"plat"`
PlatVip int32 `json:"platVip"`
Invited string `json:"invited"`
Ext interface{} `json:"ext"`
NickName string `json:"nickname"`
}
@ -40,6 +41,7 @@ type Session interface {
GetInvited() string
GetNickName() string
IsGuest() int32
GetExt() string
}
type SessionMgr interface {

View File

@ -19,6 +19,7 @@ type User struct {
Avatar string `gorm:"column:avatar"`
NickName string `gorm:"column:nickname"`
Invited string `gorm:"column:invited"`
Ext string `gorm:"column:ext"`
Plat int32 `gorm:"column:plat"`
PlatVip int32 `gorm:"column:plat_vip"`
Score int64 `gorm:"column:score"`

View File

@ -1,6 +1,7 @@
package session
import (
"q5"
"main/common"
)
@ -52,3 +53,7 @@ func (this *session) GetNickName() string {
func (this *session) IsGuest() int32 {
return this.isGuest
}
func (this *session) GetExt() string {
return q5.EncodeJson(this.jwtUserInfo.Ext)
}