```
feat(login): 优化登录服务错误处理和用户状态验证 - 修改GetUserInfo错误处理,将致命错误改为业务错误返回 - 移除登录查询中的status条件限制 - 添加账户封禁状态检查功能 - 修复缓存设置中的passwordVersion参数传递问题 refactor(task): 调整任务配置表结构和字段定义 - 将表名从task_config改为config_task - 移除TaskName字段 - 将ElfRewardIds从数组
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
// 表名常量定义:任务配置表
|
||||
const (
|
||||
TableNameTaskConfig = "task_config" // 任务配置表(记录任务ID、类型、目标、奖励、状态等核心信息)
|
||||
TableNameTaskConfig = "config_task" // 任务配置表(记录任务ID、类型、目标、奖励、状态等核心信息)
|
||||
)
|
||||
|
||||
// TaskConfig 任务核心配置模型
|
||||
@@ -14,12 +14,11 @@ 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:"任务名称"`
|
||||
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;type:json;default:'[]';comment:'绑定奖励精灵ID数组,关联config_pet_boss表主键'" json:"elf_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:"是否启用"`
|
||||
|
||||
@@ -11,14 +11,15 @@ const (
|
||||
|
||||
// PetReward 精灵奖励基础配置模型(核心存储结构,与数据库表字段一一对应)
|
||||
type PetReward struct {
|
||||
*cool.Model // 嵌入通用Model(包含ID/创建时间/更新时间等通用字段,保持与BossConfig一致)
|
||||
IsEnabled uint32 `gorm:"not null;default:0;comment:'是否启用(0-禁用 1-启用)'" json:"is_enabled"`
|
||||
MonID int32 `gorm:"not null;comment:'BOSS对应的精灵ID'" json:"mon_id"`
|
||||
DV int32 `gorm:"not null;default:0;comment:'成长值'" json:"dv"`
|
||||
Nature uint32 `gorm:"not null;default:0;comment:'BOSS属性-性格'" json:"nature"`
|
||||
Effect uint32 `gorm:"not null;comment:'BOSS特性'" json:"effect"`
|
||||
Lv int32 `gorm:"not null;comment:'BOSS等级(LvHpMatchUser非0时此配置无效)'" json:"lv"`
|
||||
IsEgg uint32 `gorm:"not null;default:0;comment:'是否蛋'" json:"is_egg"` //奖励是否为扭蛋奖励
|
||||
*cool.Model // 嵌入通用Model(包含ID/创建时间/更新时间等通用字段,保持与BossConfig一致)
|
||||
IsEnabled uint32 `gorm:"not null;default:0;comment:'是否启用(0-禁用 1-启用)'" json:"is_enabled"`
|
||||
MonID int32 `gorm:"not null;comment:'BOSS对应的精灵ID'" json:"mon_id"`
|
||||
DV int32 `gorm:"not null;default:0;comment:'成长值'" json:"dv"`
|
||||
Nature uint32 `gorm:"not null;default:0;comment:'BOSS属性-性格'" json:"nature"`
|
||||
Effect int32 `gorm:"not null;comment:'BOSS特性'" json:"effect"`
|
||||
Lv int32 `gorm:"not null;comment:'BOSS等级(LvHpMatchUser非0时此配置无效)'" json:"lv"`
|
||||
IsEgg uint32 `gorm:"not null;default:0;comment:'是否蛋'" json:"is_egg"` //奖励是否为扭蛋奖励
|
||||
Desc *string `gorm:"size:512;default:'';comment:'BOSS描述'" json:"desc"`
|
||||
}
|
||||
|
||||
// TableName 指定PetReward对应的数据库表名(遵循现有代码规范)
|
||||
|
||||
Reference in New Issue
Block a user