feat: 实现每日签到功能并优化战斗和道具逻辑
This commit is contained in:
@@ -1,40 +1,14 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
)
|
||||
import configmodel "blazing/modules/config/model"
|
||||
|
||||
// 表名常量(遵循现有命名规范:小写+下划线)
|
||||
const TableNameSignIn = "config_sign_in"
|
||||
// Deprecated: 签到配置已迁移到 modules/config/model/sign.go。
|
||||
const TableNameSignIn = configmodel.TableNameSignIn
|
||||
|
||||
// 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{})
|
||||
// Deprecated: 签到配置已迁移到 modules/config/model/sign.go。
|
||||
type SignIn = configmodel.SignIn
|
||||
|
||||
// Deprecated: 签到配置已迁移到 modules/config/model/sign.go。
|
||||
func NewSignIn() *configmodel.SignIn {
|
||||
return configmodel.NewSignIn()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user