| | |
| | | public ResponseResult deleteWayline(@PathVariable(name = "workspace_id") String workspaceId, |
| | | @PathVariable(name = "wayline_id") String waylineId) { |
| | | boolean isDel = waylineFileService.deleteByWaylineId(workspaceId, waylineId); |
| | | return isDel ? ResponseResult.success() : ResponseResult.error("Failed to delete wayline."); |
| | | return isDel ? ResponseResult.success() : ResponseResult.error("航线删除失败"); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/{workspace_id}/waylines/file/upload") |
| | | public ResponseResult importKmzFile(HttpServletRequest request, MultipartFile file) { |
| | | public ResponseResult importKmzFile(@PathVariable(name = "workspace_id") String workspaceId,HttpServletRequest request, MultipartFile file) { |
| | | if (Objects.isNull(file)) { |
| | | return ResponseResult.error("No file received."); |
| | | return ResponseResult.error("未上传文件"); |
| | | } |
| | | CustomClaim customClaim = (CustomClaim)request.getAttribute(TOKEN_CLAIM); |
| | | String workspaceId = customClaim.getWorkspaceId(); |
| | | String creator = customClaim.getUsername(); |
| | | waylineFileService.importKmzFile(file, workspaceId, creator); |
| | | return ResponseResult.success(); |