1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-20 22:39:04 +08:00
parent 922f7c3622
commit f6b583575a
5 changed files with 30 additions and 30 deletions

View File

@@ -14,7 +14,7 @@ func init() {
// 初始化控制器配置路由前缀、支持的API、绑定Service
var petFusionController = &PetFusionController{
&cool.Controller{
Prefix: "/admin/pet/fusion", // 路由前缀(按模块分类:宠物-融合配方)
Prefix: "/admin/config/fusion", // 路由前缀(按模块分类:宠物-融合配方)
Api: []string{"Add", "Delete", "Update", "Info", "List", "Page"}, // 支持的基础CRUD接口
Service: service.NewPetFusionService(), // 绑定主表Service
},

View File

@@ -14,9 +14,9 @@ func init() {
// 初始化控制器配置路由前缀、支持的API、绑定Service
var petFusionMaterialController = &PetFusionMaterialController{
&cool.Controller{
Prefix: "/admin/pet/fusionmaterial", // 路由前缀(主表路由+子表名,层级清晰)
Prefix: "/admin/config/fusionmaterial", // 路由前缀(主表路由+子表名,层级清晰)
Api: []string{"Add", "Delete", "Update", "Info", "List", "Page"}, // 支持的基础CRUD接口
Service: service.NewPetFusionMaterialService(), // 绑定子表Service
Service: service.NewPetFusionMaterialService(), // 绑定子表Service
},
}
// 注册控制器到框架

View File

@@ -11,17 +11,15 @@ const (
// MapConfig 地图核心配置模型(包含地图基础属性、刷怪配置、天气配置、掉落物配置)
type MapConfig struct {
*BaseConfig
*cool.Model // 保留通用ModelID/创建时间/更新时间等)
// 核心字段
MapID uint32 `gorm:"not null;primaryKey;comment:'地图唯一ID主键'" json:"map_id" description:"地图ID"`
IsSpawnMonster int32 `gorm:"not null;default:0;comment:'是否开启刷怪1:开启0:关闭)'" json:"is_spawn_monster" description:"是否开启刷怪"`
//`gorm:"type:int[];comment:'副宠物IDs1,2,3'" json:"sub_pet_ids"`
WeatherType []uint32 `gorm:"type:int[];comment:'天气类型( 1-雨天2-雪天)'" json:"weather_type"`
// 掉落物配置
DropItemIds []uint32 `gorm:"type:int[];comment:'掉落物IDs" json:"drop_item_ids"`
Remark string `gorm:"type:varchar(255);default:'';comment:'性别配置备注(如:默认性别规则)'" json:"remark"` // 调整注释
}
// -------------------------- 核心配套方法(遵循项目规范)--------------------------
@@ -35,7 +33,7 @@ func (*MapConfig) GroupName() string {
func NewMapConfig() *MapConfig {
return &MapConfig{
BaseConfig: NewBaseConfig(),
Model: cool.NewModel(),
}
}

View File

@@ -22,7 +22,7 @@ func NewMapService() *MapService {
func (s *MapService) GetData(p1 uint32) (ret *model.MapConfig) {
//cacheKey := strings.Join([]string{fmt.Sprintf("%d", p1), fmt.Sprintf("%d", p2)}, ":")
m := dbm_enable(s.Model)
m := dbm_notenable(s.Model)
m.Wheref(`male_pet_ids @> ARRAY[?]::integer[]`, p1).Scan(&ret)