🎉 初始化项目

Signed-off-by: Echo <1711788888@qq.com>
This commit is contained in:
2026-02-27 21:52:00 +08:00
commit f4e166c5ee
482 changed files with 55079 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
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"
}