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', `avatar` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'avatar',
`nickname` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'nickname', `nickname` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'nickname',
`invited` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'invited', `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` int(11) NOT NULL DEFAULT '0' COMMENT 'plat',
`plat_vip` int(11) NOT NULL DEFAULT '0' COMMENT 'plat_vip', `plat_vip` int(11) NOT NULL DEFAULT '0' COMMENT 'plat_vip',
`score` bigint(11) NOT NULL DEFAULT '0' COMMENT 'score', `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 '创建时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
UNIQUE KEY `uk_account_id` (`account_id`), UNIQUE KEY `uk_account_id` (`account_id`),
KEY (`openid`)
PRIMARY KEY (`idx`) PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;

View File

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

View File

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

View File

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