From 3656e43d3cb8116633905d264fa58a552aafa389 Mon Sep 17 00:00:00 2001 From: xinian Date: Sun, 1 Mar 2026 09:28:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=8E=A5=E5=8F=A3=E5=B9=B6=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=9C=B0=E5=9B=BE=E8=AF=B7=E6=B1=82=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增地图提示接口/maptip,同时将/timemap接口的请求方法从POST改为GET --- modules/config/controller/admin/map.go | 12 +++++++++++- modules/config/service/map.go | 9 +++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/config/controller/admin/map.go b/modules/config/controller/admin/map.go index 2fbcf31af..8b0a0965b 100644 --- a/modules/config/controller/admin/map.go +++ b/modules/config/controller/admin/map.go @@ -25,7 +25,7 @@ func init() { } type TimeMapReq struct { - g.Meta `path:"/timemap" method:"POST"` + g.Meta `path:"/timemap" method:"GET"` } func (this *MapController) TimeMap(ctx context.Context, req *TimeMapReq) (res *cool.BaseRes, err error) { @@ -33,3 +33,13 @@ func (this *MapController) TimeMap(ctx context.Context, req *TimeMapReq) (res *c res.Data = service.NewMapService().GetTimeMap() return res, nil } + +type MapTipReq struct { + g.Meta `path:"/maptip" method:"GET"` +} + +func (this *MapController) MapTip(ctx context.Context, req *MapTipReq) (res *cool.BaseRes, err error) { + res = &cool.BaseRes{} + res.Data = service.NewMapService().GetTimeMap() + return res, nil +} diff --git a/modules/config/service/map.go b/modules/config/service/map.go index 6240a22fa..c6dbe6a58 100644 --- a/modules/config/service/map.go +++ b/modules/config/service/map.go @@ -39,3 +39,12 @@ func (s *MapService) GetTimeMap() (ret []model.MapConfig) { return } +func (s *MapService) GetTimeTip() (ret []model.MapConfig) { + //cacheKey := strings.Join([]string{fmt.Sprintf("%d", p1), fmt.Sprintf("%d", p2)}, ":") + m := dbm_notenable(s.Model) + + m.Where(`is_time_space`, 1).Scan(&ret) + + return + +}