From c9f7314cd0e02201940a7800e5668bb4bbd932be Mon Sep 17 00:00:00 2001 From: 孤舟烟雨 <494979+gzyy@user.noreply.gitee.com> Date: 星期五, 13 八月 2021 10:03:46 +0800 Subject: [PATCH] !77 update 对象存储配置 重构到数据库 动态配置 * 增加对象存储配置sql * 修改对象存储配置 * Merge branch 'dev' of https://gitee.com/JavaLionLi/RuoYi-Vue-Plus into dev * 增加对象存储配置 * 增加对象存储配置 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java index d26de0a..13fdc67 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java @@ -7,7 +7,6 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.SysConfig; import com.ruoyi.system.service.ISysConfigService; @@ -16,11 +15,12 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 鍙傛暟閰嶇疆 淇℃伅鎿嶄綔澶勭悊 - * + * * @author ruoyi */ @RestController @@ -43,11 +43,10 @@ @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:config:export')") @GetMapping("/export") - public AjaxResult export(SysConfig config) + public void export(SysConfig config, HttpServletResponse response) { List<SysConfig> list = configService.selectConfigList(config); - ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); - return util.exportExcel(list, "鍙傛暟鏁版嵁"); + ExcelUtil.exportExcel(list, "鍙傛暟鏁版嵁", SysConfig.class, response); } /** @@ -82,7 +81,7 @@ { return AjaxResult.error("鏂板鍙傛暟'" + config.getConfigName() + "'澶辫触锛屽弬鏁伴敭鍚嶅凡瀛樺湪"); } - config.setCreateBy(SecurityUtils.getUsername()); + config.setCreateBy(getUsername()); return toAjax(configService.insertConfig(config)); } @@ -98,7 +97,7 @@ { return AjaxResult.error("淇敼鍙傛暟'" + config.getConfigName() + "'澶辫触锛屽弬鏁伴敭鍚嶅凡瀛樺湪"); } - config.setUpdateBy(SecurityUtils.getUsername()); + config.setUpdateBy(getUsername()); return toAjax(configService.updateConfig(config)); } @@ -110,18 +109,19 @@ @DeleteMapping("/{configIds}") public AjaxResult remove(@PathVariable Long[] configIds) { - return toAjax(configService.deleteConfigByIds(configIds)); + configService.deleteConfigByIds(configIds); + return success(); } /** - * 娓呯┖缂撳瓨 + * 鍒锋柊鍙傛暟缂撳瓨 */ @PreAuthorize("@ss.hasPermi('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(); } } -- Gitblit v1.9.3