🎨 重构用户端前端为vue开发,完善基础类和角色相关接口
This commit is contained in:
24
server/model/app/app_user_session.go
Normal file
24
server/model/app/app_user_session.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/st/server/global"
|
||||
"gorm.io/datatypes"
|
||||
"time"
|
||||
)
|
||||
|
||||
// AppUserSession 前台用户会话
|
||||
type AppUserSession struct {
|
||||
global.GVA_MODEL
|
||||
UserID uint `json:"userId" gorm:"index;comment:用户ID"`
|
||||
SessionToken string `json:"sessionToken" gorm:"type:varchar(500);uniqueIndex;comment:会话Token"`
|
||||
RefreshToken string `json:"refreshToken" gorm:"type:varchar(500);comment:刷新Token"`
|
||||
ExpiresAt time.Time `json:"expiresAt" gorm:"index;comment:过期时间"`
|
||||
RefreshExpiresAt *time.Time `json:"refreshExpiresAt" gorm:"comment:刷新Token过期时间"`
|
||||
IPAddress string `json:"ipAddress" gorm:"type:varchar(100);comment:IP地址"`
|
||||
UserAgent string `json:"userAgent" gorm:"type:text;comment:用户代理"`
|
||||
DeviceInfo datatypes.JSON `json:"deviceInfo" gorm:"type:jsonb;comment:设备信息"`
|
||||
}
|
||||
|
||||
func (AppUserSession) TableName() string {
|
||||
return "app_user_sessions"
|
||||
}
|
||||
Reference in New Issue
Block a user