| | |
| | | import com.dji.sample.component.mqtt.model.ChannelName; |
| | | import com.dji.sample.component.mqtt.model.CommonTopicReceiver; |
| | | import com.dji.sample.component.mqtt.model.CommonTopicResponse; |
| | | import com.dji.sample.droneairport.service.RegistService; |
| | | import com.dji.sample.manage.model.dto.DeviceDTO; |
| | | import com.dji.sample.manage.model.dto.DeviceFirmwareUpgradeDTO; |
| | | import com.dji.sample.manage.model.enums.DeviceSetPropertyEnum; |
| | |
| | | |
| | | @Autowired |
| | | private IDeviceService deviceService; |
| | | @Autowired |
| | | private RegistService registService; |
| | | |
| | | /** |
| | | * Handles the message that the drone goes online. |
| | |
| | | .timestamp(System.currentTimeMillis()) |
| | | .method(receiver.getMethod()) |
| | | .build()); |
| | | } |
| | | if (receiver.getData().getSn().length()==14){ |
| | | registService.Authorization(receiver.getData().getSn()); |
| | | } |
| | | } |
| | | |
| | |
| | | .method(receiver.getMethod()) |
| | | .build()); |
| | | |
| | | } |
| | | if (receiver.getData().getSn().length()==14){ |
| | | registService.noAuthorization(receiver.getData().getSn()); |
| | | } |
| | | } |
| | | |
| | |
| | | deviceService.devicePropertySet(workspaceId, dockSn, propertyEnumOpt.get(), param.get(property)); |
| | | return ResponseResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 红外设置方法 |
| | | * @param workspaceId |
| | | * @param dockSn |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @PutMapping("/{workspace_id}/devices/{device_sn}/property2") |
| | | public ResponseResult devicePropertySet2(@PathVariable("workspace_id") String workspaceId, |
| | | @PathVariable("device_sn") String dockSn, |
| | | @RequestBody JsonNode param) { |
| | | if (param.size() != 1) { |
| | | return ResponseResult.error(CommonErrorEnum.ILLEGAL_ARGUMENT); |
| | | } |
| | | int result = deviceService.devicePropertySet(workspaceId, dockSn, param); |
| | | return ResponseResult.success().getCode() == result ?ResponseResult.success():ResponseResult.error(); |
| | | } |
| | | |
| | | } |