aix
2024-08-06 440e415ca42276eb5f0aff562bf8c73ff8ab2c71
src/main/java/com/dji/sample/wayline/controller/WaylineFileController.java
@@ -68,6 +68,24 @@
        return ResponseResult.success(data);
    }
    @GetMapping("/{workspace_id}/formatWayline")
    @SysLogAnnotation(operModul = "航线库", operType = "查询", operDesc = "根据查询条件查询临时航路线文件的基本数据")
    public ResponseResult<PaginationData<WaylineFileDTO>> getShowWaylinesPagination(@RequestParam(name = "order_by") String orderBy,
                                                                                @RequestParam(required = false) boolean favorited, @RequestParam Integer page,
                                                                                @RequestParam(name = "page_size", defaultValue = "10") Integer pageSize,
                                                                                @RequestParam(name = "template_type", required = false) Integer[] templateType,
                                                                                @PathVariable(name = "workspace_id") String workspaceId) {
        WaylineQueryParam param = WaylineQueryParam.builder()
                .favorited(favorited)
                .page(page)
                .pageSize(pageSize)
                .orderBy(orderBy)
                .templateType(templateType)
                .build();
        PaginationData<WaylineFileDTO> data = waylineFileService.getShowWaylinesByParam(workspaceId, param);
        return ResponseResult.success(data);
    }
    /**
     * 根据wayline文件id查询文件的下载地址;
     * 和重定向到此地址直接下载。
@@ -88,6 +106,12 @@
        } catch (IOException | SQLException e) {
            e.printStackTrace();
        }
    }
    @GetMapping("/{workspace_id}/getWayline")
    public ResponseResult getWaylineByJobId(
            @PathVariable(name = "workspace_id") String workspaceId,
            @RequestParam String jobId) {
        return ResponseResult.success(waylineFileService.getWaylineByWaylineId(workspaceId,jobId));
    }
    @GetMapping("/{workspace_id}/waylines/{wayline_id}/urlData")
@@ -206,14 +230,14 @@
    public ResponseResult importKmzFile(@PathVariable(name = "workspace_id") String workspaceId,
                                        HttpServletRequest request, MultipartFile file,
                                        @RequestParam(required = false) String patchesId,
                                        @RequestParam(required = false) String spotInFreckle
                                        @RequestParam(defaultValue = "1",required = false) String isTemp
    ) {
        if (Objects.isNull(file)) {
            return ResponseResult.error("未上传文件");
        }
        CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM);
        String creator = customClaim.getUsername();
        String back = waylineFileService.importKmzFile(file, workspaceId, creator, patchesId, spotInFreckle);
        String back = waylineFileService.importKmzFile(file, workspaceId, creator, patchesId,isTemp);
        if (back != null) {
            return ResponseResult.error(back);
        }