From a48154a2ee94c9346309af1a9e270e47b6d9eb42 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 11 八月 2021 15:43:23 +0800
Subject: [PATCH] update 补全基础实体 文档注解
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java | 262 +++++++++++++++++++++++++---------------------------
1 files changed, 127 insertions(+), 135 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 41b8209..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
@@ -1,135 +1,127 @@
-package com.ruoyi.web.controller.system;
-
-import java.util.List;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.ruoyi.common.annotation.Log;
-import com.ruoyi.common.annotation.RepeatSubmit;
-import com.ruoyi.common.constant.UserConstants;
-import com.ruoyi.common.core.controller.BaseController;
-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;
-
-/**
- * 鍙傛暟閰嶇疆 淇℃伅鎿嶄綔澶勭悊
- *
- * @author ruoyi
- */
-@RestController
-@RequestMapping("/system/config")
-public class SysConfigController extends BaseController
-{
- @Autowired
- private ISysConfigService configService;
-
- /**
- * 鑾峰彇鍙傛暟閰嶇疆鍒楄〃
- */
- @PreAuthorize("@ss.hasPermi('system:config:list')")
- @GetMapping("/list")
- public TableDataInfo list(SysConfig config)
- {
- startPage();
- List<SysConfig> list = configService.selectConfigList(config);
- return getDataTable(list);
- }
-
- @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.EXPORT)
- @PreAuthorize("@ss.hasPermi('system:config:export')")
- @GetMapping("/export")
- public AjaxResult export(SysConfig config)
- {
- List<SysConfig> list = configService.selectConfigList(config);
- ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
- return util.exportExcel(list, "鍙傛暟鏁版嵁");
- }
-
- /**
- * 鏍规嵁鍙傛暟缂栧彿鑾峰彇璇︾粏淇℃伅
- */
- @PreAuthorize("@ss.hasPermi('system:config:query')")
- @GetMapping(value = "/{configId}")
- public AjaxResult getInfo(@PathVariable Long configId)
- {
- return AjaxResult.success(configService.selectConfigById(configId));
- }
-
- /**
- * 鏍规嵁鍙傛暟閿悕鏌ヨ鍙傛暟鍊�
- */
- @GetMapping(value = "/configKey/{configKey}")
- public AjaxResult getConfigKey(@PathVariable String configKey)
- {
- return AjaxResult.success(configService.selectConfigByKey(configKey));
- }
-
- /**
- * 鏂板鍙傛暟閰嶇疆
- */
- @PreAuthorize("@ss.hasPermi('system:config:add')")
- @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.INSERT)
- @PostMapping
- @RepeatSubmit
- public AjaxResult add(@Validated @RequestBody SysConfig config)
- {
- if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
- {
- return AjaxResult.error("鏂板鍙傛暟'" + config.getConfigName() + "'澶辫触锛屽弬鏁伴敭鍚嶅凡瀛樺湪");
- }
- config.setCreateBy(SecurityUtils.getUsername());
- return toAjax(configService.insertConfig(config));
- }
-
- /**
- * 淇敼鍙傛暟閰嶇疆
- */
- @PreAuthorize("@ss.hasPermi('system:config:edit')")
- @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@Validated @RequestBody SysConfig config)
- {
- if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
- {
- return AjaxResult.error("淇敼鍙傛暟'" + config.getConfigName() + "'澶辫触锛屽弬鏁伴敭鍚嶅凡瀛樺湪");
- }
- config.setUpdateBy(SecurityUtils.getUsername());
- return toAjax(configService.updateConfig(config));
- }
-
- /**
- * 鍒犻櫎鍙傛暟閰嶇疆
- */
- @PreAuthorize("@ss.hasPermi('system:config:remove')")
- @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.DELETE)
- @DeleteMapping("/{configIds}")
- public AjaxResult remove(@PathVariable Long[] configIds)
- {
- return toAjax(configService.deleteConfigByIds(configIds));
- }
-
- /**
- * 娓呯┖缂撳瓨
- */
- @PreAuthorize("@ss.hasPermi('system:config:remove')")
- @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.CLEAN)
- @DeleteMapping("/clearCache")
- public AjaxResult clearCache()
- {
- configService.clearCache();
- return AjaxResult.success();
- }
-}
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.annotation.RepeatSubmit;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+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.poi.ExcelUtil;
+import com.ruoyi.system.domain.SysConfig;
+import com.ruoyi.system.service.ISysConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 鍙傛暟閰嶇疆 淇℃伅鎿嶄綔澶勭悊
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/system/config")
+public class SysConfigController extends BaseController
+{
+ @Autowired
+ private ISysConfigService configService;
+
+ /**
+ * 鑾峰彇鍙傛暟閰嶇疆鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('system:config:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(SysConfig config)
+ {
+ return configService.selectPageConfigList(config);
+ }
+
+ @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.EXPORT)
+ @PreAuthorize("@ss.hasPermi('system:config:export')")
+ @GetMapping("/export")
+ public void export(SysConfig config, HttpServletResponse response)
+ {
+ List<SysConfig> list = configService.selectConfigList(config);
+ ExcelUtil.exportExcel(list, "鍙傛暟鏁版嵁", SysConfig.class, response);
+ }
+
+ /**
+ * 鏍规嵁鍙傛暟缂栧彿鑾峰彇璇︾粏淇℃伅
+ */
+ @PreAuthorize("@ss.hasPermi('system:config:query')")
+ @GetMapping(value = "/{configId}")
+ public AjaxResult getInfo(@PathVariable Long configId)
+ {
+ return AjaxResult.success(configService.selectConfigById(configId));
+ }
+
+ /**
+ * 鏍规嵁鍙傛暟閿悕鏌ヨ鍙傛暟鍊�
+ */
+ @GetMapping(value = "/configKey/{configKey}")
+ public AjaxResult getConfigKey(@PathVariable String configKey)
+ {
+ return AjaxResult.success(configService.selectConfigByKey(configKey));
+ }
+
+ /**
+ * 鏂板鍙傛暟閰嶇疆
+ */
+ @PreAuthorize("@ss.hasPermi('system:config:add')")
+ @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.INSERT)
+ @PostMapping
+ @RepeatSubmit
+ public AjaxResult add(@Validated @RequestBody SysConfig config)
+ {
+ if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
+ {
+ return AjaxResult.error("鏂板鍙傛暟'" + config.getConfigName() + "'澶辫触锛屽弬鏁伴敭鍚嶅凡瀛樺湪");
+ }
+ config.setCreateBy(getUsername());
+ return toAjax(configService.insertConfig(config));
+ }
+
+ /**
+ * 淇敼鍙傛暟閰嶇疆
+ */
+ @PreAuthorize("@ss.hasPermi('system:config:edit')")
+ @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@Validated @RequestBody SysConfig config)
+ {
+ if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
+ {
+ return AjaxResult.error("淇敼鍙傛暟'" + config.getConfigName() + "'澶辫触锛屽弬鏁伴敭鍚嶅凡瀛樺湪");
+ }
+ config.setUpdateBy(getUsername());
+ return toAjax(configService.updateConfig(config));
+ }
+
+ /**
+ * 鍒犻櫎鍙傛暟閰嶇疆
+ */
+ @PreAuthorize("@ss.hasPermi('system:config:remove')")
+ @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{configIds}")
+ public AjaxResult remove(@PathVariable Long[] configIds)
+ {
+ configService.deleteConfigByIds(configIds);
+ return success();
+ }
+
+ /**
+ * 鍒锋柊鍙傛暟缂撳瓨
+ */
+ @PreAuthorize("@ss.hasPermi('system:config:remove')")
+ @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.CLEAN)
+ @DeleteMapping("/refreshCache")
+ public AjaxResult refreshCache()
+ {
+ configService.resetConfigCache();
+ return AjaxResult.success();
+ }
+}
--
Gitblit v1.9.3