class SysConfigController {
    @Autowired
    private SysConfigService configService;

    @GetMapping(value = "page", name = "参数配置管理-分页")
    @PreAuthorize("@ss.hasPermi('system:config:list')")
    public R page(SysConfigEntity sysConfigEntity) {
        PageResult<SysConfigEntity> page = configService.page(sysConfigEntity);

        return R.ok().put(page);
    }

    @GetMapping(value = "{id}", name = "参数配置管理-查询id信息")
    @PreAuthorize("@ss.hasPermi('system:config:query')")
    public R getInfo(@PathVariable("id") Long id) {
        SysConfigEntity entity = configService.selectConfigById(id);

        return R.ok().put(entity);
    }

    /**
     * 根据参数键名查询参数值
     */
    @GetMapping(value = "/configKey/{configKey:.+}")
    public R getConfigKey(@PathVariable String configKey) {
        return R.ok(configService.selectConfigByKey(configKey));
    }

    @PostMapping(name = "参数配置管理-新增")
    @PreAuthorize("@ss.hasPermi('system:config:add')")
    public R add(@Validated @RequestBody SysConfigEntity config) {<FILL_FUNCTION_BODY>}

    @PutMapping(name = "参数配置管理-修改")
    @PreAuthorize("@ss.hasPermi('system:config:edit')")
    public R edit(@Validated @RequestBody SysConfigEntity config) {
        if (!configService.checkConfigKeyUnique(config)) {
            return R.error("修改参数'" + config.getConfigName() + "'失败，参数键名已存在");
        }
        return R.ok(configService.updateConfig(config));

    }

    @DeleteMapping(value = "/{configIds}", name = "参数配置管理-删除")
    @PreAuthorize("@ss.hasPermi('system:config:remove')")
    public R remove(@PathVariable Long[] configIds) {
        configService.deleteConfigByIds(configIds);

        return R.ok();
    }

    /**
     * 刷新参数缓存
     */
    @PreAuthorize("@ss.hasPermi('system:config:remove')")
    @DeleteMapping(value = "/refreshCache", name = "参数配置管理-刷新缓存")
    public R refreshCache() {
        configService.resetConfigCache();
        return R.ok();
    }
}

        if (!configService.checkConfigKeyUnique(config)) {
            return R.error("新增参数'" + config.getConfigName() + "'失败，参数键名已存在");
        }
        return R.ok(configService.insertConfig(config));

    
<no_super_class>