From 0e0a6258ce04c9b89fdf1b5507675f35f8a09124 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期六, 08 十月 2022 11:04:18 +0800
Subject: [PATCH] 菜单,单位,数据目录递归查询,批量修改

---
 src/main/java/com/lf/server/controller/data/DirController.java |   49 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/data/DirController.java b/src/main/java/com/lf/server/controller/data/DirController.java
index 349a6da..bb735e7 100644
--- a/src/main/java/com/lf/server/controller/data/DirController.java
+++ b/src/main/java/com/lf/server/controller/data/DirController.java
@@ -1,8 +1,8 @@
 package com.lf.server.controller.data;
 
-import com.lf.server.controller.BaseController;
+import com.lf.server.aspect.SysLog;
+import com.lf.server.controller.all.BaseController;
 import com.lf.server.entity.all.ResponseMsg;
-import com.lf.server.entity.data.DictEntity;
 import com.lf.server.entity.data.DirEntity;
 import com.lf.server.service.data.DirService;
 import io.swagger.annotations.Api;
@@ -10,6 +10,7 @@
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
@@ -19,13 +20,14 @@
  * @author sws
  * @date   2022-09-22
  */
-@Api(tags = "鐩綍绠$悊")
+@Api(tags = "鏁版嵁绠$悊\\鐩綍绠$悊")
 @RestController
 @RequestMapping("/dir")
 public class DirController extends BaseController {
     @Autowired
     DirService dirService;
 
+    @SysLog()
     @ApiOperation(value = "鎻掑叆鏁版嵁")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "DirEntity", value = "鐩綍瀹炰綋绫�", dataType = "com.lf.server.entity.data.DirEntity", paramType = "body", example = "")
@@ -41,6 +43,7 @@
         }
     }
 
+    @SysLog()
     @ApiOperation(value = "鎻掑叆澶氭潯鏁版嵁")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "DirEntity", value = "鐩綍瀹炰綋绫�", dataType = "com.lf.server.entity.data.DirEntity", paramType = "body", example = "")
@@ -56,6 +59,7 @@
         }
     }
 
+    @SysLog()
     @ApiOperation(value = "鍒犻櫎涓�鏉℃暟鎹�")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "涓婚敭ID", dataType = "Integer", paramType = "query", example = "1")
@@ -71,9 +75,10 @@
         }
     }
 
+    @SysLog()
     @ApiOperation(value = "鍒犻櫎澶氭潯鏁版嵁")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "ids", value = "涓婚敭ID闆嗗悎", dataType = "List<Integer>", paramType = "query", example = "1,2")
+            @ApiImplicitParam(name = "DirEntity", value = "鐩綍瀹炰綋绫�", dataType = "com.lf.server.entity.data.DirEntity", paramType = "body", example = "")
     })
     @GetMapping(value = "/deleteDirs")
     public ResponseMsg<Integer> deleteDirs(@RequestParam List<Integer> ids) {
@@ -90,6 +95,7 @@
         }
     }
 
+    @SysLog()
     @ApiOperation(value = "鏇存柊涓�鏉℃暟鎹�")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "dirEntity", value = "涓婚敭ID闆嗗悎", dataType = "DictEntity", paramType = "body", example = "")
@@ -106,6 +112,27 @@
         }
     }
 
+    @SysLog()
+    @ApiOperation(value = "鏇存柊澶氭潯鏁版嵁")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "DirEntity", value = "涓婚敭ID闆嗗悎", dataType = "DirEntity", paramType = "body", example = "")
+    })
+    @ResponseBody
+    @PostMapping(value = "/updateDirs", produces = "application/json; charset=UTF-8")
+    public ResponseMsg<Integer> updateDirs(@RequestBody List<DirEntity> dirEntity) {
+        try {
+            int count = dirService.updateDirs(dirEntity);
+
+            return success(count);
+        } catch (Exception ex) {
+            return fail(ex.getMessage(), -1);
+        }
+    }
+
+
+
+
+    @SysLog()
     @ApiOperation(value = "鏍规嵁ID鏌ヨ鏁版嵁")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "涓婚敭ID", dataType = "Integer", paramType = "query", example = "1")
@@ -121,7 +148,7 @@
         }
     }
 
-
+    @SysLog()
     @ApiOperation(value = "鏌ヨ鎵�鏈夋暟鎹�")
     @GetMapping(value = "/selectDirAll")
     public ResponseMsg<List<DirEntity>> selectDirAll() {
@@ -132,4 +159,16 @@
             return fail(ex.getMessage(), null);
         }
     }
+
+    @SysLog()
+    @ApiOperation(value = "閫掑綊鏌ヨ鏁版嵁")
+    @GetMapping(value = "/selectDirRecursive")
+    public ResponseMsg<List<DirEntity>> selectDirRecursive() {
+        try {
+            List<DirEntity> list = dirService.selectDirRecursive();
+            return success(list);
+        } catch (Exception ex) {
+            return fail(ex.getMessage(), null);
+        }
+    }
 }

--
Gitblit v1.9.3