From 9e4ea95b250f8f6696c0afe277850cb6a04133dc Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期日, 08 一月 2023 20:15:16 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/controller/data/upload/UploadController.java | 86 +++++++++++++++++++++--------------------- 1 files changed, 43 insertions(+), 43 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 9bf1e71..c76ebf7 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 @@ -77,6 +77,47 @@ } @SysLog() + @ApiOperation(value = "鏌ヨ鏂囦欢") + @ApiImplicitParams({ + @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query") + }) + @GetMapping(value = "/selectFiles") + public ResponseMsg<List<MetaFileEntity>> selectFiles(String path) { + try { + 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") @@ -97,26 +138,10 @@ @ApiImplicitParams({ @ApiImplicitParam(name = "path", value = "璺緞", dataType = "String", paramType = "query") }) - @GetMapping(value = "/selectFiles") - public ResponseMsg<List<MetaEntity>> selectFiles(String path) { - try { - List<MetaEntity> list = baseUploadService.selectFiles(path, EXT_LIST); - - 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 = "/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 +212,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