管道基础大数据平台系统开发-【后端】-Server
13693261870
2023-01-08 d5be1b8fad7c7a4455d89a3e14e3496dcd93ac33
src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -56,6 +56,27 @@
    }
    @SysLog()
    @ApiOperation(value = "上传文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "path", value = "路径", dataType = "String", paramType = "query")
    })
    @ResponseBody
    @PostMapping(value = "/uploadFiles")
    public ResponseMsg<Object> uploadFiles(String path, HttpServletRequest req, HttpServletResponse res) {
        try {
            List<MetaEntity> 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")
@@ -166,31 +187,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 = "path", value = "路径", dataType = "String", paramType = "query")
    })
    @ResponseBody
    @PostMapping(value = "/uploadFiles")
    public ResponseMsg<Object> uploadFiles(String path, HttpServletRequest req, HttpServletResponse res) {
        try {
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue == null) {
                return fail("用户未登录", null);
            }
            List<MetaEntity> 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);
        }