| | |
| | | import com.ruoyi.common.core.web.page.TableDataInfo;
|
| | | import com.ruoyi.common.log.annotation.Log;
|
| | | import com.ruoyi.common.log.enums.BusinessType;
|
| | | import com.ruoyi.common.security.annotation.PreAuthorize;
|
| | | import com.ruoyi.common.security.annotation.RequiresPermissions;
|
| | | import com.ruoyi.system.domain.SysConfig;
|
| | | import com.ruoyi.system.service.ISysConfigService;
|
| | |
|
| | |
| | | /**
|
| | | * 获取参数配置列表
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:config:list")
|
| | | @RequiresPermissions("system:config:list")
|
| | | @GetMapping("/list")
|
| | | public TableDataInfo list(SysConfig config)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | @Log(title = "参数管理", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize(hasPermi = "system:config:export")
|
| | | @RequiresPermissions("system:config:export")
|
| | | @PostMapping("/export")
|
| | | public void export(HttpServletResponse response, SysConfig config) throws IOException
|
| | | {
|
| | |
| | | /**
|
| | | * 新增参数配置
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:config:add")
|
| | | @RequiresPermissions("system:config:add")
|
| | | @Log(title = "参数管理", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@Validated @RequestBody SysConfig config)
|
| | |
| | | /**
|
| | | * 修改参数配置
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:config:edit")
|
| | | @RequiresPermissions("system:config:edit")
|
| | | @Log(title = "参数管理", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
| | |
| | | /**
|
| | | * 删除参数配置
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:config:remove")
|
| | | @RequiresPermissions("system:config:remove")
|
| | | @Log(title = "参数管理", businessType = BusinessType.DELETE)
|
| | | @DeleteMapping("/{configIds}")
|
| | | public AjaxResult remove(@PathVariable Long[] configIds)
|
| | | {
|
| | | return toAjax(configService.deleteConfigByIds(configIds));
|
| | | configService.deleteConfigByIds(configIds);
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 清空缓存
|
| | | * 刷新参数缓存
|
| | | */
|
| | | @PreAuthorize(hasPermi = "system:config:remove")
|
| | | @RequiresPermissions("system:config:remove")
|
| | | @Log(title = "参数管理", businessType = BusinessType.CLEAN)
|
| | | @DeleteMapping("/clearCache")
|
| | | public AjaxResult clearCache()
|
| | | @DeleteMapping("/refreshCache")
|
| | | public AjaxResult refreshCache()
|
| | | {
|
| | | configService.clearCache();
|
| | | configService.resetConfigCache();
|
| | | return AjaxResult.success();
|
| | | }
|
| | | }
|