Files
bl/modules/blazing/model/sign.go
昔念 f6a305de77 ```
feat(fight): 添加 BOSS 战斗逻辑与地图交互功能

- 在 fight_boss.go 中增加对 BOSS 血量是否为 0 的判断,避免无效赋值
- 在 map.go 中移除旧的测试代码,并将 Canmon 状态设置移至 MapList 方法中
- 新增 Attack_Boss 接口方法用于处理玩家攻击 BOSS 请求
- 修改 MapBossInfo 结构体字段类型
2025-12-09 14:52:55 +08:00

45 lines
1.5 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_record"
// SignInRecord 玩家签到明细记录表
// 记录玩家每一次的签到行为,关联签到活动表
type SignInRecord struct {
*cool.Model // 嵌入基础Model主键、创建/更新时间等通用字段)
// 核心关联字段
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{
Model: cool.NewModel(),
}
}
// init 程序启动时自动创建表与现有SignIn表初始化逻辑一致
func init() {
cool.CreateTable(&SignInRecord{})
}