admin
2022-10-28 0e9b6603d4ae9d11c1fbc90257ce816c5807b8ff
app/src/main/java/com/yeshi/makemoney/app/controller/admin/config/SystemConfigAdminController.java
@@ -3,6 +3,7 @@
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;
@@ -35,8 +36,8 @@
    @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(query.getType() == null ? SystemConfigType.common : query.getType());
        long count = list.size();
        JSONObject data = new JSONObject();
        Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
@@ -92,13 +93,15 @@
    @ResponseBody
    @RequestMapping("getKeyList")
    public String getKeyList() {
    public String getKeyList(SystemConfigType type) {
        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() == (type == null ? SystemConfigType.common : type)) {
                JSONObject data = new JSONObject();
                data.put("key", key.name());
                data.put("value", key.getDesc());
                array.add(data);
            }
        }
        return JsonUtil.loadTrueResult(array);
    }