Files
st-react/server/model/app/app_user_session.go
Echo f4e166c5ee 🎉 初始化项目
Signed-off-by: Echo <1711788888@qq.com>
2026-02-27 21:52:00 +08:00

26 lines
1005 B
Go

package app
import (
"time"
"git.echol.cn/loser/st/server/global"
"gorm.io/datatypes"
)
// 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"
}