| | |
| | | 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.common.util.MinioUrlUtils; |
| | | 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.dto.WaylineListDTO; |
| | | import com.dji.sample.wayline.model.entity.WaylineFileEntity; |
| | | import com.dji.sample.wayline.model.param.WaylineQueryParam; |
| | | import com.dji.sample.wayline.service.IWaylineFileService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | |
| | | try { |
| | | URL url = waylineFileService.getObjectUrl(workspaceId, waylineId); |
| | | response.sendRedirect(url.toString()); |
| | | response.sendRedirect(MinioUrlUtils.getUrl(url)); |
| | | |
| | | } catch (IOException | SQLException e) { |
| | | e.printStackTrace(); |
| | |
| | | } catch (SQLException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return ResponseResult.success(url); |
| | | return ResponseResult.success(MinioUrlUtils.getUrl(url)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @GetMapping("/{workspace_id}/waylines_list") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "查询", operDesc = "查询当前工作区航线库列表") |
| | | public ResponseResult<List<WaylineListDTO>> waylineList(@PathVariable(name = "workspace_id") String workspaceId) { |
| | | return ResponseResult.success(waylineFileService.waylineList(workspaceId)) ; |
| | | public ResponseResult<List<WaylineListDTO>> waylineList(@PathVariable(name = "workspace_id") String workspaceId,String droneName) { |
| | | return ResponseResult.success(waylineFileService.waylineList(workspaceId,droneName)) ; |
| | | } |
| | | |
| | | @PutMapping("/{workspace_id}/wayline_update") |
| | | public ResponseResult upWayline(@RequestParam String waylineId,@RequestParam String name){ |
| | | WaylineFileEntity entity=WaylineFileEntity |
| | | .builder() |
| | | .waylineId(waylineId) |
| | | .name(name) |
| | | .build(); |
| | | if(waylineFileService.updateWayline(entity)==0){ |
| | | return ResponseResult.error("更新失败"); |
| | | }else return ResponseResult.success(); |
| | | } |
| | | } |