管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-04-03 64bfe6434504ac9838fd91b8746deffae61c3dc6
1
已修改1个文件
17 ■■■■ 文件已修改
src/main/java/com/lf/server/controller/data/MetaController.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/MetaController.java
@@ -368,33 +368,32 @@
    @SysLog()
    @ApiOperation(value = "请求下载")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pwd", value = "密码", dataType = "String", paramType = "body", example = ""),
            @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "body", example = "1,2")
            @ApiImplicitParam(name = "dr", value = "请求下载实体类", dataType = "DownloadReqEntity", paramType = "body")
    })
    @ResponseBody
    @PostMapping(value = "/downloadReq")
    public ResponseMsg<Object> downloadReq(@RequestBody DownloadReqEntity reqEntity, HttpServletRequest req, HttpServletResponse res) {
    public ResponseMsg<Object> downloadReq(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) {
        try {
            if (null == reqEntity || StringHelper.isEmpty(reqEntity.getPwd())) {
            if (null == dr || StringHelper.isEmpty(dr.getPwd())) {
                return fail("密码不能为空");
            }
            if (null == reqEntity.getIds() || reqEntity.getIds().isEmpty()) {
            if (null == dr.getIds() || dr.getIds().isEmpty()) {
                return fail("请选择要下载的文件");
            }
            if (!DownloadService.decryptPwd(reqEntity)) {
            if (!DownloadService.decryptPwd(dr)) {
                return fail("密码解密失败", null);
            }
            if (StringHelper.isPwdInvalid(reqEntity.getPwd())) {
            if (StringHelper.isPwdInvalid(dr.getPwd())) {
                return fail("密码不符合要求");
            }
            List<MetaEntity> list = metaService.selectMetaFiles(reqEntity.getIds());
            List<MetaEntity> list = metaService.selectMetaFiles(dr.getIds());
            if (null == list || list.isEmpty()) {
                return fail("没有找到元数据");
            }
            UserEntity ue = tokenService.getCurrentUser(req);
            String guid = downloadService.zipFiles(ue, list, reqEntity.getPwd());
            String guid = downloadService.zipFiles(ue, list, dr.getPwd());
            return success(guid);
        } catch (Exception ex) {