管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-01-08 739391fd331ef521d00594074a696baff7046c1e
1
已修改1个文件
82 ■■■■ 文件已修改
src/main/java/com/lf/server/controller/data/upload/UploadController.java 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -77,22 +77,6 @@
    }
    @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) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "查询文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "path", value = "路径", dataType = "String", paramType = "query")
@@ -101,6 +85,47 @@
    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 = "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);
        }
    }
    @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) {
@@ -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);
        }