//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) {
|
// }
|
// }
|
//}
|