Files
bl/modules/config/model/TaskConfig.go
昔念 eebf46cc03 ```
refactor(item_use): 重构道具使用逻辑并提取常量

- 添加 ItemDefaultLeftTime 和 ItemNeuronID 常量定义
- 使用结构体字面量初始化 itemInfo,替换手动赋值
- 将神经元道具处理逻辑提取为独立方法 handleNeuronItem
- 将普通宠物道具处理逻辑提取为独立方法 handleRegularPetItem
- 优化 UsePetItemOutOfFight 方法的条件判断结构

fix(NewSeIdx_700): 修复Boss技能伤害计算参数错误

- 修正 Skill_Useed 方法中 Div 方法的参数索引,从 Args()[1]
2025-12-31 02:44:14 +08:00

49 lines
1.6 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 = "task_config" // 任务配置表记录任务ID、类型、目标、奖励、状态等核心信息
)
// TaskConfig 任务核心配置模型
type TaskConfig struct {
*cool.Model
// 核心字段
TaskId uint32 `gorm:"not null;uniqueIndex;comment:'任务唯一ID'" json:"task_id" description:"任务唯一ID"`
TaskName string `gorm:"not null;size:128;comment:'任务名称'" json:"task_name" description:"任务名称"`
// 奖励配置
ItemRewardIds []uint32 `gorm:"not null;type:json;default:'[]';comment:'绑定奖励物品ID数组关联item_gift表主键'" json:"item_reward_ids" description:"奖励物品数组"`
ElfRewardIds []uint32 `gorm:"not null;type:json;default:'[]';comment:'绑定奖励精灵ID数组关联config_pet_boss表主键'" json:"elf_reward_ids" description:"奖励精灵数组"`
// 任务状态和周期
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{})
}