feat: 添加地图提示接口并修改时间地图请求方法
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
新增地图提示接口/maptip,同时将/timemap接口的请求方法从POST改为GET
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user