| | |
| | | */ |
| | | @ApiOperation("获取设备当前航线状态") |
| | | @GetMapping("/{boxSn}/state") |
| | | public RouteState getRouteState(@PathVariable String boxSn) { |
| | | return stateMachineService.getCurrentState(boxSn); |
| | | public AjaxResult getRouteState(@PathVariable String boxSn) { |
| | | return AjaxResult.success(stateMachineService.getCurrentState(boxSn)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation("重置设备航线状态") |
| | | @PostMapping("/{boxSn}/reset") |
| | | public String resetRouteState(@PathVariable String boxSn) { |
| | | public AjaxResult resetRouteState(@PathVariable String boxSn) { |
| | | stateMachineService.resetStateMachine(boxSn); |
| | | return "设备" + boxSn + "航线状态已重置为:" + RouteState.IDLE; |
| | | return AjaxResult.success( "设备" + boxSn + "航线状态已重置为:" + RouteState.IDLE); |
| | | } |
| | | } |