From 8a072bd028bcb8cb994d92463f7a0db34dad3d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Tue, 24 Feb 2026 19:20:38 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(config):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=9D=91=E4=BD=8D=E9=85=8D=E7=BD=AE=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将MapPit结构体中的MapID字段从数组类型[]int32改为单个int32类型 - 更新数据库标签,移除数组类型定义,添加非空约束和索引 - 修改JSON标签注释为"所属地图ID" - 在服务层的查询操作中添加map_id字段的相等查询支持 ``` --- modules/config/model/map_pit.go | 2 +- modules/config/service/map_pit.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/config/model/map_pit.go b/modules/config/model/map_pit.go index cab7c694b..22c951e64 100644 --- a/modules/config/model/map_pit.go +++ b/modules/config/model/map_pit.go @@ -24,7 +24,7 @@ type MapPit struct { *BaseConfig *Event // 复用通用基础配置(ID/创建时间/更新时间等) - MapID []int32 `gorm:"type:int[];comment:'绑定地图地图ID'" json:"map_id"` + MapID int32 `gorm:"not null;index;comment:'所属地图ID'" json:"map_id" description:"地图ID"` RefreshID []int `gorm:"type:int[];comment:'精灵ID列表'" json:"refresh_id"` Pos []int `gorm:"type:int[];comment:'坑位位置'" json:"pos"` diff --git a/modules/config/service/map_pit.go b/modules/config/service/map_pit.go index 2cb320f9f..bc2b4a2d8 100644 --- a/modules/config/service/map_pit.go +++ b/modules/config/service/map_pit.go @@ -15,6 +15,7 @@ func NewMapPitService() *MapPitService { Model: model.NewMapPit(), PageQueryOp: &cool.QueryOp{ KeyWordField: []string{"remake"}, + FieldEQ: []string{"map_id"}, }, }, }