liujie
2025-11-26 c04fea693bdf99ce7a36c54ddecef2116dd31907
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//package com.stylefeng.guns.modular.api;
//
//
//import com.stylefeng.guns.core.base.controller.BaseController;
//import com.stylefeng.guns.modular.system.model.Dict;
//import com.stylefeng.guns.modular.system.service.IDictService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
///**
// * 地图接口调度器
// *
// * @author Maple
// * @Date 2024/12/12 17:02
// */
//@RestController
//@RequestMapping("/mapDispatch")
//public class MapDispatchController extends BaseController {
//    @Autowired
//    private IDictService dictService;
//
//
//    /**
//     * 获取地图Key
//     *
//     * @param serverName 服务名称(管理端、司机端、用户端)
//     * @return
//     */
//    @GetMapping(value = "/getMapKey")
//    public Object getMapKey(@RequestParam("serverName") String serverName) {
//        List<Dict> dictList = dictService.selectByCode(serverName);
//        if (dictList == null || dictList.isEmpty()) {
//            return null;
//        } else {
//            return dictList.get(0).getName();
//        }
//    }
//
//    /**
//     * 获取输入提示Key
//     *
//     * @param serverName 服务名称(管理端、司机端、用户端)
//     * @param apiName    API名称(inputtips:输入提示)
//     * @return
//     */
//    @GetMapping(value = "/getInputtips")
//    public String getInputtips(@RequestParam("serverName") String serverName, @RequestParam("apiName") String apiName) {
//        switch (apiName) {
//            case "inputtips":
//                //切换新的key
//                return getInputtips();
//            default:
//                return "";
//        }
//    }
//    /**
//     * 刷新输入提示Key
//     *
//     * @param serverName 服务名称(管理端、司机端、用户端)
//     * @param apiName    API名称(inputtips:输入提示)
//     * @return
//     */
//    @GetMapping(value = "/refreshInputtips")
//    public void refreshInputtips(@RequestParam("serverName") String serverName, @RequestParam("apiName") String apiName) {
//        switch (apiName) {
//            case "inputtips":
//                //切换新的key
//                switchinputtips();
//                break;
//        }
//    }
//
//    private String getInputtips() {
//        List<Dict> dictList = dictService.selectByCode("gaode_inputtips_switch");
//        if (dictList == null || dictList.isEmpty()) {
//            return "";
//        }
//        try {
//            int index = Integer.parseInt(dictList.get(0).getName());
//            Dict indexdic = dictList.get(0);
//            dictList.clear();
//            Dict dict = dictService.selectByChildrenCode("gaode_inputtips", indexdic.getName());
//            if (dict==null){
//                return "";
//            }
//            else {
//                return dict.getName();
//            }
//        } catch (NumberFormatException ignored) {
//            return "";
//        }
//    }
//    private void switchinputtips() {
//        List<Dict> dictList = dictService.selectByCode("gaode_inputtips_switch");
//        if (dictList == null || dictList.isEmpty()) {
//            return;
//        }
//        try {
//            int index = Integer.parseInt(dictList.get(0).getName());
//            Dict indexdic = dictList.get(0);
//            dictList.clear();
//            dictList = dictService.selectByParentCode("gaode_inputtips");
//            if (dictList.isEmpty()) {
//                return;
//            }
//            if (index == 0) {
//                indexdic.setName("1");
//                dictService.updateById(indexdic);
//            } else if (index < dictList.size()) {
//                indexdic.setName(String.valueOf(++index));
//                dictService.updateById(indexdic);
//            }
//            else {
//                System.out.println("高德【输入提示】Key池已用尽!");
//            }
//        } catch (NumberFormatException ignored) {
//        }
//    }
//}