| | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfig; |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfigKey; |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfigType; |
| | | import com.yeshi.makemoney.app.service.inter.config.SystemConfigService; |
| | | import com.yeshi.makemoney.app.service.query.config.SystemConfigQuery; |
| | | import com.yeshi.makemoney.app.vo.AcceptAdminData; |
| | |
| | | @ResponseBody |
| | | @RequestMapping("list") |
| | | public String list(SystemConfigQuery query, int page, int limit, String callback) { |
| | | List<SystemConfig> list = systemConfigService.list(query, page, limit); |
| | | long count = systemConfigService.count(query); |
| | | List<SystemConfig> list = systemConfigService.listByType(SystemConfigType.common); |
| | | long count = list.size(); |
| | | JSONObject data = new JSONObject(); |
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | |
| | |
| | | public String getKeyList() { |
| | | JSONArray array = new JSONArray(); |
| | | for (SystemConfigKey key : SystemConfigKey.values()) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", key.name()); |
| | | data.put("value", key.getDesc()); |
| | | array.add(data); |
| | | if (key.getType() == SystemConfigType.common) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", key.name()); |
| | | data.put("value", key.getDesc()); |
| | | array.add(data); |
| | | } |
| | | } |
| | | return JsonUtil.loadTrueResult(array); |
| | | } |