| | |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | import static com.dji.sample.component.AuthInterceptor.TOKEN_CLAIM; |
| | | |
| | |
| | | public ResponseResult droneStatus(@RequestParam String deviceid, HttpServletResponse response) throws Exception { |
| | | Map<String, String> info=registService.getDroneState(deviceid); |
| | | response.setHeader("x-lc-secret", info.get("serect")); |
| | | return ResponseResult.success(info.get("text")); |
| | | return ResponseResult.success(200,"获取无人机机场状态成功!",info.get("text"),UUID.randomUUID().toString()); |
| | | } |
| | | |
| | | @PostMapping("/AddTask") |
| | |
| | | String creator = customClaim.getUsername(); |
| | | Map<String, String> info = registService.AddTask(body, headerValue, creator); |
| | | response.setHeader("x-lc-secret", info.get("serect")); |
| | | return ResponseResult.success(200, "无人机机场任务添加成功", info.get("traceId"), info.get("jobId")); |
| | | return ResponseResult.success(200, "无人机机场任务添加成功", info.get("taskid"),info.get("traceId")); |
| | | } |
| | | |
| | | @PostMapping("/updateTask") |
| | |
| | | String creator = customClaim.getUsername(); |
| | | Map<String, String> info = registService.updateTask(body, headerValue, creator); |
| | | response.setHeader("x-lc-secret", info.get("serect")); |
| | | return ResponseResult.success(200, "无人机机场任务更新成功", info.get("traceId"), info.get("jobId")); |
| | | return ResponseResult.success(200, "无人机机场任务更新成功",info.get("taskid"), info.get("traceId")); |
| | | } |
| | | |
| | | @GetMapping("/cancelTask") |
| | | public ResponseResult cancelTask(@RequestParam String taskid) { |
| | | return ResponseResult.success(registService.cancelTask(taskid)); |
| | | public ResponseResult cancelTask(@RequestParam String taskid,HttpServletResponse response) throws InvalidCipherTextException, IOException { |
| | | Map<String, String> info=registService.cancelTask(taskid); |
| | | response.setHeader("x-lc-secret", info.get("serect")); |
| | | return ResponseResult.success(200,"无人机任务取消成功",info.get("taskid"), UUID.randomUUID().toString()); |
| | | } |
| | | @PostMapping("/queryTaskStatus") |
| | | public ResponseResult queryTaskStatus(HttpServletRequest request, @RequestParam String taskid) throws Exception { |