| | |
| | | import com.dji.sample.common.model.CustomClaim; |
| | | import com.dji.sample.common.model.PaginationData; |
| | | import com.dji.sample.common.model.ResponseResult; |
| | | import com.dji.sample.log.aspect.SysLogAnnotation; |
| | | import com.dji.sample.wayline.model.dto.WaylineFileDTO; |
| | | import com.dji.sample.wayline.model.dto.WaylineFileUploadDTO; |
| | | import com.dji.sample.wayline.model.param.WaylineQueryParam; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/{workspace_id}/waylines") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "查询", operDesc = "根据查询条件查询航路线文件的基本数据") |
| | | public ResponseResult<PaginationData<WaylineFileDTO>> getWaylinesPagination(@RequestParam(name = "order_by") String orderBy, |
| | | @RequestParam(required = false) boolean favorited, @RequestParam Integer page, |
| | | @RequestParam(name = "page_size", defaultValue = "10") Integer pageSize, |
| | |
| | | * @param response |
| | | */ |
| | | @GetMapping("/{workspace_id}/waylines/{wayline_id}/url") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "查询", operDesc = "根据wayline文件id查询文件的下载地址1") |
| | | public void getFileUrl(@PathVariable(name = "workspace_id") String workspaceId, |
| | | @PathVariable(name = "wayline_id") String waylineId, HttpServletResponse response) { |
| | | |
| | |
| | | } |
| | | |
| | | @GetMapping("/{workspace_id}/waylines/{wayline_id}/urlData") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "查询", operDesc = "根据wayline文件id查询文件的下载地址2") |
| | | public ResponseResult getFileUrlData(@PathVariable(name = "workspace_id") String workspaceId, |
| | | @PathVariable(name = "wayline_id") String waylineId, HttpServletResponse response) { |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/{workspace_id}/upload-callback") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "新增", operDesc = "当航路线文件被飞行员上传到存储服务器时,通过该接口报告文件的基本信息") |
| | | public ResponseResult uploadCallBack(HttpServletRequest request, |
| | | @PathVariable(name = "workspace_id") String workspaceId, |
| | | @RequestBody WaylineFileUploadDTO uploadFile) { |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/{workspace_id}/favorites") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "修改", operDesc = "根据路径线文件id收藏路径线文件") |
| | | public ResponseResult markFavorite(@PathVariable(name = "workspace_id") String workspaceId, |
| | | @RequestParam(name = "id") List<String> ids) { |
| | | boolean isMark = waylineFileService.markFavorite(workspaceId, ids, true); |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{workspace_id}/favorites") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "删除", operDesc = "根据航路线文件id删除此航路线文件的收藏夹") |
| | | public ResponseResult unmarkFavorite(@PathVariable(name = "workspace_id") String workspaceId, |
| | | @RequestParam(name = "id") List<String> ids) { |
| | | boolean isMark = waylineFileService.markFavorite(workspaceId, ids, false); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/{workspace_id}/waylines/duplicate-names") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "查询", operDesc = "根据航路线名称检查名称是否已经存在") |
| | | public ResponseResult checkDuplicateNames(@PathVariable(name = "workspace_id") String workspaceId, |
| | | @RequestParam(name = "name") List<String> names) { |
| | | List<String> existNamesList = waylineFileService.getDuplicateNames(workspaceId, names); |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{workspace_id}/waylines/{wayline_id}") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "删除", operDesc = "根据航路线id删除工作区中的航路线文件") |
| | | public ResponseResult deleteWayline(@PathVariable(name = "workspace_id") String workspaceId, |
| | | @PathVariable(name = "wayline_id") String waylineId) { |
| | | boolean isDel = waylineFileService.deleteByWaylineId(workspaceId, waylineId); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/{workspace_id}/waylines/file/upload") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "上传", operDesc = "上传kmz航线文件") |
| | | public ResponseResult importKmzFile(@PathVariable(name = "workspace_id") String workspaceId,HttpServletRequest request, MultipartFile file) { |
| | | if (Objects.isNull(file)) { |
| | | return ResponseResult.error("未上传文件"); |