From f0ecfaaeccbeb123b3d3f0a3e159a34ab4fd820c Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 09 一月 2023 09:00:32 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/controller/data/upload/UploadController.java | 90 ++++++++++++++++++++++---------------------- 1 files changed, 45 insertions(+), 45 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..28380aa 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,7 +65,7 @@ @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); } @@ -75,6 +76,46 @@ } } + @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 = "鏌ヨ鏄犲皠") @@ -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