Files
bl/modules/config/model/user_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

41 lines
1.3 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 TableNameSignIn = "config_sign_in"
// SignIn 签到记录表
// 核心字段:签到完成状态、状压签到进度、签到奖励脚本
type SignIn struct {
*cool.Model // 嵌入基础Model包含主键、创建/更新时间等通用字段)
SignInID uint32 `gorm:"not null;index:idx_sign_in_id;comment:'签到活动ID'" json:"sign_in_id"`
Status uint32 `gorm:"not null;default:0;comment:'签到状态0-未完成 1-已完成)'" json:"status"`
//传入用户名,签到天数,给予奖励,这个搭配里程碑表实现
RewardScript string `gorm:"type:varchar(512);default:'';comment:'签到奖励脚本(执行奖励发放的脚本内容)'" json:"reward_script"`
}
// TableName 指定表名(遵循现有规范)
func (*SignIn) TableName() string {
return TableNameSignIn
}
// GroupName 指定表分组默认分组与现有Item表/精灵特效表一致)
func (*SignIn) GroupName() string {
return "default"
}
// NewSignIn 创建签到记录表实例初始化基础Model
func NewSignIn() *SignIn {
return &SignIn{
Model: cool.NewModel(),
}
}
// init 程序启动时自动创建表与现有PlayerPetSpecialEffect表的初始化逻辑一致
func init() {
cool.CreateTable(&SignIn{})
}