admin
2022-04-07 e1cc0d03fadc2d251d36c0dc3650f75e830d5363
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(SystemConfigType.common);
        long count = list.size();
        JSONObject data = new JSONObject();
        Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
@@ -95,10 +96,12 @@
    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);
    }