| | |
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private AdminUserService adminUserService;
|
| | | |
| | | |
| | | @RequestMapping(value = "getConfigList", method = RequestMethod.POST)
|
| | | public void getConfigList(PrintWriter out){
|
| | | List<Config> configList = configService.getAllList();
|
| | | out.print(JsonUtil.loadTrueResult(configList));
|
| | | }
|
| | | |
| | | @RequestMapping(value = "updateConfig", method = RequestMethod.POST)
|
| | | public void updateConfig(String map, PrintWriter out) {
|
| | | List<Config> list = configService.getAllList();
|
| | | List<Config> newList = new ArrayList<Config>();
|
| | | Map<String, String> data = JsonUtil.parseData(map);
|
| | | for (Config config : list) {
|
| | | String key = config.getKey();
|
| | | if(data.containsKey(key)){
|
| | | String value =data.get(key);
|
| | | if(!config.getValue().equals(value)){
|
| | | config.setValue(value);
|
| | | newList.add(config);
|
| | | }
|
| | | }
|
| | | }
|
| | | configService.update(newList);
|
| | | out.print(JsonUtil.loadTrueResult("修改成功"));
|
| | | return;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询列表 - 新后台
|