From ff912b5a2abd0016cc8afca66cb64d0a0190364d Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期一, 09 一月 2023 09:51:39 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/controller/data/upload/UploadController.java |   99 +++++++++++++++++++++++++------------------------
 1 files changed, 51 insertions(+), 48 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/data/upload/UploadController.java b/src/main/java/com/lf/server/controller/data/upload/UploadController.java
index e2a5abe..8395029 100644
--- a/src/main/java/com/lf/server/controller/data/upload/UploadController.java
+++ b/src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -5,6 +5,7 @@
 import com.lf.server.entity.ctrl.TabMapperEntity;
 import com.lf.server.entity.ctrl.UploadEntity;
 import com.lf.server.entity.data.MetaEntity;
+import com.lf.server.entity.data.MetaFileEntity;
 import com.lf.server.entity.sys.UserEntity;
 import com.lf.server.helper.WebHelper;
 import com.lf.server.service.all.BaseUploadService;
@@ -29,7 +30,7 @@
  */
 @Api(tags = "鏁版嵁绠$悊\\鏁版嵁涓婁紶")
 @RestController
-@RequestMapping("/dataLoader")
+@RequestMapping("/dataUpload")
 public class UploadController extends QueryController {
     @Autowired
     protected DataLoaderService dataLoaderService;
@@ -64,27 +65,10 @@
     @PostMapping(value = "/uploadFiles")
     public ResponseMsg<Object> uploadFiles(String path, HttpServletRequest req, HttpServletResponse res) {
         try {
-            List<MetaEntity> list = baseUploadService.uploadData(null, path, req, res);
+            List<MetaFileEntity> list = baseUploadService.uploadData(null, path, req, res);
             if (null == list || list.isEmpty()) {
                 return fail("娌℃湁鎵惧埌涓婁紶鏂囦欢", null);
             }
-
-            return success(list);
-        } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
-        }
-    }
-
-
-    @SysLog()
-    @ApiOperation(value = "鏌ヨ鏄犲皠")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query")
-    })
-    @GetMapping(value = "/selectMappers")
-    public ResponseMsg<List<TabMapperEntity>> selectMappers(String path) {
-        try {
-            List<TabMapperEntity> list = dataLoaderService.selectMappers(path);
 
             return success(list);
         } catch (Exception ex) {
@@ -98,9 +82,53 @@
             @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query")
     })
     @GetMapping(value = "/selectFiles")
-    public ResponseMsg<List<MetaEntity>> selectFiles(String path) {
+    public ResponseMsg<List<MetaFileEntity>> selectFiles(String path) {
         try {
-            List<MetaEntity> list = baseUploadService.selectFiles(path, EXT_LIST);
+            List<MetaFileEntity> list = baseUploadService.selectFiles(path, EXT_LIST);
+
+            return success(list);
+        } catch (Exception ex) {
+            return fail(ex.getMessage(), null);
+        }
+    }
+
+    @SysLog()
+    @ApiOperation(value = "鍒犻櫎鏂囦欢")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", dataType = "MetaEntity", paramType = "body")
+    })
+    @ResponseBody
+    @PostMapping(value = "/deleteFiles")
+    public ResponseMsg<Object> deleteFiles(@RequestBody List<MetaFileEntity> list, HttpServletRequest req) {
+        try {
+            UserEntity ue = tokenService.getCurrentUser(req);
+            if (ue == null) {
+                return fail("鐢ㄦ埛鏈櫥褰�", null);
+            }
+            if (null == list || list.isEmpty()) {
+                return fail("娌℃湁鎵惧埌鏂囦欢", null);
+            }
+
+            int rows = baseUploadService.deleteFiles(list);
+
+            return success("鎴愬姛", rows);
+        } catch (Exception ex) {
+            return fail(ex.getMessage(), null);
+        }
+    }
+
+    @SysLog()
+    @ApiOperation(value = "鏌ヨ鏄犲皠")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query", example = "20230109010101"),
+            @ApiImplicitParam(name = "dirid", value = "鐩綍ID", dataType = "Integer", paramType = "query", example = "1")
+    })
+    @GetMapping(value = "/selectMappers")
+    public ResponseMsg<List<TabMapperEntity>> selectMappers(String path, Integer dirid) {
+        try {
+
+
+            List<TabMapperEntity> list = dataLoaderService.selectMappers(path);
 
             return success(list);
         } catch (Exception ex) {
@@ -114,9 +142,9 @@
             @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query")
     })
     @GetMapping(value = "/selectFiles2")
-    public ResponseMsg<List<MetaEntity>> selectFiles2(String path) {
+    public ResponseMsg<List<MetaFileEntity>> selectFiles2(String path) {
         try {
-            List<MetaEntity> list = baseUploadService.selectFiles(path, null);
+            List<MetaFileEntity> list = baseUploadService.selectFiles(path, null);
 
             return success(list);
         } catch (Exception ex) {
@@ -187,31 +215,6 @@
             dataLoaderService.insertFiles(me, entity.getFileEntities(), entity.getTabEntities());
 
             return success("鎴愬姛", entity.getTabEntities());
-        } catch (Exception ex) {
-            return fail(ex.getMessage(), null);
-        }
-    }
-
-    @SysLog()
-    @ApiOperation(value = "鍒犻櫎鏂囦欢")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", dataType = "MetaEntity", paramType = "body")
-    })
-    @ResponseBody
-    @PostMapping(value = "/deleteFiles")
-    public ResponseMsg<Object> deleteFiles(@RequestBody List<MetaEntity> list, HttpServletRequest req) {
-        try {
-            UserEntity ue = tokenService.getCurrentUser(req);
-            if (ue == null) {
-                return fail("鐢ㄦ埛鏈櫥褰�", null);
-            }
-            if (null == list || list.isEmpty()) {
-                return fail("娌℃湁鎵惧埌鏂囦欢", null);
-            }
-
-            int rows = baseUploadService.deleteFiles(list);
-
-            return success("鎴愬姛", rows);
         } catch (Exception ex) {
             return fail(ex.getMessage(), null);
         }

--
Gitblit v1.9.3