Files
bl/modules/config/model/TaskConfig.go
昔念 c082eb3e91 ```
feat(login): 优化登录服务错误处理和用户状态验证

- 修改GetUserInfo错误处理,将致命错误改为业务错误返回
- 移除登录查询中的status条件限制
- 添加账户封禁状态检查功能
- 修复缓存设置中的passwordVersion参数传递问题

refactor(task): 调整任务配置表结构和字段定义

- 将表名从task_config改为config_task
- 移除TaskName字段
- 将ElfRewardIds从数组
2025-12-31 18:58:44 +08:00

48 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 (
TableNameTaskConfig = "config_task" // 任务配置表记录任务ID、类型、目标、奖励、状态等核心信息
)
// TaskConfig 任务核心配置模型
type TaskConfig struct {
*cool.Model
// 核心字段
TaskId uint32 `gorm:"not null;uniqueIndex;comment:'任务唯一ID'" json:"task_id" description:"任务唯一ID"`
// 奖励配置
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{})
}