From 6c637ece7a0bfe131a93cdef688063a0b408ed17 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 10 四月 2024 13:58:24 +0800
Subject: [PATCH] sql备份
---
ycl-server/src/main/java/com/ycl/platform/controller/CheckRuleController.java | 148 +++++++++++++++++++++++++++++--------------------
1 files changed, 87 insertions(+), 61 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CheckRuleController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CheckRuleController.java
index 8fd63eb..bac5c34 100644
--- a/ycl-server/src/main/java/com/ycl/platform/controller/CheckRuleController.java
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/CheckRuleController.java
@@ -1,73 +1,99 @@
package com.ycl.platform.controller;
-import com.ycl.system.domain.group.Update;
-import com.ycl.system.domain.group.Add;
-import org.springframework.validation.annotation.Validated;
-import lombok.RequiredArgsConstructor;
-import java.util.List;
-import jakarta.validation.constraints.NotEmpty;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import com.ycl.platform.service.CheckRuleService;
-import com.ycl.system.Result;
-import com.ycl.platform.domain.form.CheckRuleForm;
-import com.ycl.platform.domain.query.CheckRuleQuery;
+import annotation.Log;
+import com.ycl.platform.domain.entity.CheckRule;
+import com.ycl.platform.service.ICheckRuleService;
+import com.ycl.system.AjaxResult;
+import com.ycl.system.controller.BaseController;
+import com.ycl.system.page.TableDataInfo;
+import com.ycl.utils.poi.ExcelUtil;
+import enumeration.BusinessType;
+import jakarta.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
+
/**
- * 鑰冩牳瑙勫垯 鍓嶇鎺у埗鍣�
+ * 鑰冩牳瑙勫垯Controller
*
- * @author xp
- * @since 2024-03-06
+ * @author ruoyi
+ * @date 2024-04-01
*/
-@Validated
-@RequiredArgsConstructor
-@Api(value = "鑰冩牳瑙勫垯", tags = "鑰冩牳瑙勫垯绠$悊")
@RestController
-@RequestMapping("/check-rule")
-public class CheckRuleController {
+@RequestMapping("/check/rule")
+public class CheckRuleController extends BaseController
+{
+ @Autowired
+ private ICheckRuleService checkRuleService;
- private final CheckRuleService checkRuleService;
-
- @PostMapping
- @ApiOperation(value = "娣诲姞", notes = "娣诲姞")
- public Result add(@RequestBody @Validated(Add.class) CheckRuleForm form) {
- return checkRuleService.add(form);
- }
-
- @PutMapping
- @ApiOperation(value = "淇敼", notes = "淇敼")
- public Result update(@RequestBody @Validated(Update.class) CheckRuleForm form) {
- return checkRuleService.update(form);
- }
-
- @DeleteMapping("/{id}")
- @ApiOperation(value = "ID鍒犻櫎", notes = "ID鍒犻櫎")
- public Result removeById(@PathVariable("id") String id) {
- return checkRuleService.removeById(id);
- }
-
- @DeleteMapping("/batch")
- @ApiOperation(value = "鎵归噺鍒犻櫎", notes = "鎵归噺鍒犻櫎")
- public Result remove(@RequestBody @NotEmpty(message = "璇烽�夋嫨鏁版嵁") List<String> ids) {
- return checkRuleService.remove(ids);
- }
-
- @PostMapping("/page")
- @ApiOperation(value = "鍒嗛〉", notes = "鍒嗛〉")
- public Result page(@RequestBody CheckRuleQuery query) {
- return checkRuleService.page(query);
- }
-
- @GetMapping("/{id}")
- @ApiOperation(value = "璇︽儏", notes = "璇︽儏")
- public Result detail(@PathVariable("id") String id) {
- return checkRuleService.detail(id);
- }
-
+ /**
+ * 鏌ヨ鑰冩牳瑙勫垯鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('system:rule:list')")
@GetMapping("/list")
- @ApiOperation(value = "鍒楄〃", notes = "鍒楄〃")
- public Result list() {
- return checkRuleService.all();
+ public TableDataInfo list(CheckRule checkRule)
+ {
+ startPage();
+ List<CheckRule> list = checkRuleService.selectCheckRuleList(checkRule);
+ return getDataTable(list);
+ }
+
+ /**
+ * 瀵煎嚭鑰冩牳瑙勫垯鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('system:rule:export')")
+ @Log(title = "鑰冩牳瑙勫垯", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, CheckRule checkRule)
+ {
+ List<CheckRule> list = checkRuleService.selectCheckRuleList(checkRule);
+ ExcelUtil<CheckRule> util = new ExcelUtil<CheckRule>(CheckRule.class);
+ util.exportExcel(response, list, "鑰冩牳瑙勫垯鏁版嵁");
+ }
+
+ /**
+ * 鑾峰彇鑰冩牳瑙勫垯璇︾粏淇℃伅
+ */
+ @PreAuthorize("@ss.hasPermi('system:rule:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id)
+ {
+ return success(checkRuleService.selectCheckRuleById(id));
+ }
+
+ /**
+ * 鏂板鑰冩牳瑙勫垯
+ */
+ @PreAuthorize("@ss.hasPermi('system:rule:add')")
+ @Log(title = "鑰冩牳瑙勫垯", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody CheckRule checkRule)
+ {
+ return toAjax(checkRuleService.insertCheckRule(checkRule));
+ }
+
+ /**
+ * 淇敼鑰冩牳瑙勫垯
+ */
+ @PreAuthorize("@ss.hasPermi('system:rule:edit')")
+ @Log(title = "鑰冩牳瑙勫垯", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody CheckRule checkRule)
+ {
+ return toAjax(checkRuleService.updateCheckRule(checkRule));
+ }
+
+ /**
+ * 鍒犻櫎鑰冩牳瑙勫垯
+ */
+ @PreAuthorize("@ss.hasPermi('system:rule:remove')")
+ @Log(title = "鑰冩牳瑙勫垯", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids)
+ {
+ return toAjax(checkRuleService.deleteCheckRuleByIds(ids));
}
}
--
Gitblit v1.8.0