refactor(config): 调整MapBoss结构体字段类型 - 将BossMonID字段从[]int切片类型改为int单值类型,并移除相关定义 - 将WinBonusID和FailBonusID字段从[]int切片类型改为int单值类型, 并设置默认值为0 - 移除多余的空行和格式调整,保持代码整洁
This commit is contained in:
22
modules/config/controller/admin/map_boss.go
Normal file
22
modules/config/controller/admin/map_boss.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/config/service"
|
||||
)
|
||||
|
||||
type MapBossController struct {
|
||||
*cool.Controller
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
// 注册路由
|
||||
cool.RegisterController(&MapBossController{
|
||||
&cool.Controller{
|
||||
Prefix: "/admin/config/mapboss",
|
||||
Api: []string{"Add", "Delete", "Update", "Info", "List", "Page"},
|
||||
Service: service.NewMapBossService(),
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -14,12 +14,11 @@ type MapBoss struct {
|
||||
*Event // 嵌入BOSS事件配置
|
||||
MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"`
|
||||
// BOSS唯一标识ID
|
||||
BossID int `gorm:"not null;index;comment:'BOSSID'" json:"boss_id"`
|
||||
BossName string `gorm:"type:varchar(100);default:'';comment:'BOSS名称'" json:"boss_name" description:"BOSS名称"`
|
||||
BossMonID []int `gorm:"type:int[];comment:'BOSS怪ID列表'" json:"boss_mon_id"`
|
||||
BossID int `gorm:"not null;index;comment:'BOSSID'" json:"boss_id"`
|
||||
BossName string `gorm:"type:varchar(100);default:'';comment:'BOSS名称'" json:"boss_name" description:"BOSS名称"`
|
||||
|
||||
WinBonusID []int `gorm:"type:int[];comment:'胜利奖励ID'" json:"win_bonus_id"`
|
||||
FailBonusID []int `gorm:"type:int[];comment:'失败奖励ID'" json:"fail_bonus_id"`
|
||||
WinBonusID int `gorm:"type:int;default:0;comment:'胜利奖励ID'" json:"win_bonus_id"`
|
||||
FailBonusID int `gorm:"type:int;default:0;comment:'失败奖励ID'" json:"fail_bonus_id"`
|
||||
//是否可捕捉MapPit
|
||||
IsCapture int `gorm:"type:int;default:0;comment:'是否可捕捉'" json:"is_capture"`
|
||||
}
|
||||
|
||||
22
modules/config/service/map_boos.go
Normal file
22
modules/config/service/map_boos.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/config/model"
|
||||
)
|
||||
|
||||
type MapBossService struct {
|
||||
*cool.Service
|
||||
}
|
||||
|
||||
func NewMapBossService() *MapBossService {
|
||||
return &MapBossService{
|
||||
&cool.Service{
|
||||
Model: model.NewMapBoss(),
|
||||
PageQueryOp: &cool.QueryOp{
|
||||
KeyWordField: []string{"remake"},
|
||||
FieldEQ: []string{"map_id"},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user