Files
bl/modules/player/model/sign.go
昔念 026689f3ed ```
feat(cache): 添加复合键缓存操作支持

添加了基于 uint32+string 组合键的缓存操作方法,包括
GetByCompoundKey、SetByCompoundKey、DelByCompoundKey 和
ContainsByCompoundKey 方法,用于处理用户ID和会话ID的组合缓存场景

fix(vscode): 添加 cSpell 配置支持 struc 词汇

refactor(session): 移除过时的会话管理方法

移除了基于单一字符串键的会话管理方法,因为已迁移到使用
复合键的缓存操作方式
```
2026-01-19 18:51:56 +08:00

45 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"blazing/cool"
)
// 表名常量(遵循小写+下划线的命名规范)
const TableNameSignInRecord = "player_sign_in_log"
// SignInRecord 玩家签到明细记录表
// 记录玩家每一次的签到行为,关联签到活动表
type SignInRecord struct {
Base
// 核心关联字段
PlayerID uint32 `gorm:"not null;index:idx_player_id;comment:'玩家ID'" json:"player_id"`
SignInID uint32 `gorm:"not null;index:idx_sign_in_id;comment:'关联的签到活动ID对应player_sign_in表的SignInID'" json:"sign_in_id"`
IsCompleted bool `gorm:"not null;default:false;comment:'签到是否完成0-未完成 1-已完成)'" json:"is_completed"`
//通过bitset来实现签到的进度记录
SignInProgress []uint32 `gorm:"type:json;not null;comment:'签到进度(状压实现,存储每日签到状态)'" json:"sign_in_progress"`
}
// TableName 指定表名(遵循现有规范)
func (*SignInRecord) TableName() string {
return TableNameSignInRecord
}
// GroupName 指定表分组与现有表保持一致的default分组
func (*SignInRecord) GroupName() string {
return "default"
}
// NewSignInRecord 创建签到明细记录实例初始化基础Model
func NewSignInRecord() *SignInRecord {
return &SignInRecord{
Base: *NewBase(),
}
}
// init 程序启动时自动创建表与现有SignIn表初始化逻辑一致
func init() {
cool.CreateTable(&SignInRecord{})
}