| | |
| | | public ResponseResult devicePropertySet(@PathVariable("device_sn") String dockSn, |
| | | @RequestBody JsonNode param) { |
| | | if (param.size() != 1) { |
| | | return ResponseResult.error(CommonErrorEnum.ILLEGAL_ARGUMENT); |
| | | //return ResponseResult.error(CommonErrorEnum.ILLEGAL_ARGUMENT); |
| | | return ResponseResult.error(999,"参数不合法"); |
| | | } |
| | | String property = param.fieldNames().next(); |
| | | Optional<DeviceSetPropertyEnum> propertyEnumOpt = DeviceSetPropertyEnum.find(property); |
| | | if (propertyEnumOpt.isEmpty()) { |
| | | return ResponseResult.error(CommonErrorEnum.ILLEGAL_ARGUMENT); |
| | | //return ResponseResult.error(CommonErrorEnum.ILLEGAL_ARGUMENT); |
| | | return ResponseResult.error(999,"参数无效"); |
| | | } |
| | | deviceService.devicePropertySet(dockSn, propertyEnumOpt.get(), param); |
| | | return ResponseResult.success(); |
| | | return deviceService.devicePropertySet(dockSn, propertyEnumOpt.get(), param); |
| | | // return ResponseResult.success(); |
| | | } |
| | | |
| | | //.get(property) |