| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import static com.dji.sample.component.AuthInterceptor.TOKEN_CLAIM; |
| | | |
| | |
| | | } |
| | | |
| | | @GetMapping("/getDroneStatus/{deviceid}") |
| | | public ResponseResult droneStatus(@PathVariable(name = "deviceid") String deviceid, HttpServletRequest request) throws Exception { |
| | | public ResponseResult droneStatus(@PathVariable(name = "deviceid") String deviceid, HttpServletResponse response) throws Exception { |
| | | return ResponseResult.success(registService.getDroneState(deviceid)); |
| | | } |
| | | |
| | |
| | | CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM); |
| | | String creator = customClaim.getUsername(); |
| | | ReturnTaskParam param = registService.AddTask(body, headerValue, creator); |
| | | return ResponseResult.success(200, "无人机机场任务添加成功", param.getTraceId(), param.getWaylineId()); |
| | | return ResponseResult.success(200, "无人机机场任务添加成功", param.getTraceId(), param.getJobId()); |
| | | } |
| | | |
| | | @GetMapping("/cancelTask/{taskId}") |
| | |
| | | CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM); |
| | | String creator = customClaim.getUsername(); |
| | | ReturnTaskParam param = registService.updateTask(body, headerValue, creator); |
| | | return ResponseResult.success(200, "无人机机场任务添加成功", param.getTraceId(), param.getWaylineId()); |
| | | return ResponseResult.success(200, "无人机机场任务添加成功", param.getTraceId(), param.getJobId()); |
| | | } |
| | | @PostMapping("/queryTaskStatus") |
| | | public ResponseResult queryTaskStatus(HttpServletRequest request, @RequestParam String taskid) throws Exception { |