| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | |
| | | @Autowired |
| | | private UavService uavService; |
| | | |
| | | @Value("${uav.enabled}") |
| | | private Boolean uavEnabled; |
| | | |
| | | @PostConstruct |
| | | public void created() { |
| | | if(!uavEnabled){//无人机加入开关 |
| | | return; |
| | | } |
| | | this.uavService.login(); |
| | | } |
| | | |
| | |
| | | return this.uavService.addWaylinesPlanning(url, param); |
| | | } |
| | | |
| | | @DeleteMapping("/deleteWaylinesPlanning") |
| | | @PostMapping("/deleteWaylinesPlanning") |
| | | @ApiOperation("删除航线") |
| | | public Object deleteWaylinesPlanning(@RequestBody Map<String,String> param) { |
| | | String url = "wayline/api/v1/waylines/delete/"; |
| | |
| | | return this.uavService.updateWaylinesPlanning(url, param); |
| | | } |
| | | |
| | | @PostMapping("/addAlarm") |
| | | @ApiOperation("单点任务") |
| | | public Object addAlarm(@RequestBody Map<String,Object> param) { |
| | | String url = "manage/api/v1/alarms/add"; |
| | | return this.uavService.addAlarm(url, param); |
| | | } |
| | | |
| | | @PostMapping("/saveCurrentGroup") |
| | | @ApiOperation("同步") |
| | | public Object saveCurrentGroup(@RequestBody Map<String,Object> param) { |
| | | String url = "wayline/api/v1/waylines/planning/save_current_group"; |
| | | return this.uavService.saveCurrentGroup(url, param); |
| | | } |
| | | } |