Files
bl/modules/config/model/task.go
昔念 d88a2d19ea ```
feat(fight): 支持勇者之塔和试炼之塔战斗功能

- 实现勇者之塔(CMD 2414)和试炼之塔(CMD 2428)的战斗逻辑
- 添加Tower500Service和Tower600Service的Boss查询功能
- 统一处理两个塔的BossId
2026-01-01 15:37:43 +08:00

53 lines
1.9 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 (
TableNameTaskConfig = "config_task" // 任务配置表记录任务ID、类型、目标、奖励、状态等核心信息
)
// TaskConfig 任务核心配置模型
type TaskConfig struct {
*cool.Model
// 核心字段
TaskId uint32 `gorm:"not null;comment:'任务唯一ID'" json:"task_id" description:"任务唯一ID"`
OutState uint32 `gorm:"not null;default:0;comment:'任务分支'" json:"out_state" description:"任务分支"`
//父级任务
ParentTaskId uint32 `gorm:"not null;default:0;comment:'父级任务ID'" json:"parent_task_id" description:"父级任务ID"`
// type(任务类型0为常规任务1为日常任务),
TaskType uint32 `gorm:"not null;default:0;comment:'任务类型'" json:"task_type" description:"任务类型"`
// 奖励配置
ItemRewardIds []uint32 `gorm:"not null;type:json;default:'[]';comment:'绑定奖励物品ID数组关联item_gift表主键'" json:"item_reward_ids" description:"奖励物品数组"`
ElfRewardIds uint32 `gorm:"not null;default:0;comment:'绑定奖励精灵ID关联elf_gift表主键'" json:"elf_reward_ids" description:"绑定奖励精灵ID"`
// 任务状态和周期
IsEnabled uint32 `gorm:"not null;default:1;comment:'是否启用该任务0-禁用 1-启用)'" json:"is_enabled" description:"是否启用"`
Remark string `gorm:"size:512;default:'';comment:'任务备注'" json:"remark" description:"备注信息"`
}
// -------------------------- 核心配套方法(遵循项目规范)--------------------------
func (*TaskConfig) TableName() string {
return TableNameTaskConfig
}
func (*TaskConfig) GroupName() string {
return "default"
}
func NewTaskConfig() *TaskConfig {
return &TaskConfig{
Model: cool.NewModel(),
}
}
// -------------------------- 表结构自动同步 --------------------------
func init() {
cool.CreateTable(&TaskConfig{})
}