#
Junjie
2026-01-15 6200ba627af8af4045155c1bd7e65220ce59d6ba
src/main/java/com/zy/system/controller/ConfigController.java
@@ -13,6 +13,8 @@
import com.zy.common.entity.Parameter;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import com.zy.common.utils.RedisUtil;
import com.zy.core.enums.RedisKeyType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -23,6 +25,20 @@
    @Autowired
    private ConfigService configService;
    @Autowired
    private RedisUtil redisUtil;
    @RequestMapping(value = "/config/refreshCache")
    @ManagerAuth
    public R refreshCache(){
        HashMap<String, String> systemConfigMap = new HashMap<>();
        List<Config> configList = configService.selectList(new EntityWrapper<>());
        for (Config config : configList) {
            systemConfigMap.put(config.getCode(), config.getValue());
        }
        redisUtil.set(RedisKeyType.SYSTEM_CONFIG_MAP.key, systemConfigMap);
        return R.ok();
    }
    @RequestMapping(value = "/config/{id}/auth")
    @ManagerAuth
@@ -185,6 +201,22 @@
        return R.ok();
    }
    @RequestMapping(value = "/config/getSelectTypes")
    @ManagerAuth
    public R getSelectTypes() {
        EntityWrapper<Config> wrapper = new EntityWrapper<>();
        wrapper.setSqlSelect("DISTINCT select_type as selectType");
        wrapper.isNotNull("select_type");
        List<Map<String, Object>> maps = configService.selectMaps(wrapper);
        List<String> types = new ArrayList<>();
        for (Map<String, Object> map : maps) {
            if (map != null && map.get("selectType") != null) {
                types.add(String.valueOf(map.get("selectType")));
            }
        }
        return R.ok(types);
    }
    private static boolean checkJson(String val){
        Object parse = null;