| | |
| | | import com.ard.sample.manage.model.dto.DeviceHmsDTO; |
| | | import com.ard.sample.manage.model.param.DeviceHmsQueryParam; |
| | | import com.ard.sample.manage.service.IDeviceHmsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | * @version 1.1 |
| | | * @date 2022/7/7 |
| | | */ |
| | | |
| | | @Api(tags = "设备HMS管理") |
| | | @RestController |
| | | @Slf4j |
| | | @RequestMapping("/dock/devices") |
| | |
| | | private IDeviceHmsService deviceHmsService; |
| | | |
| | | /** |
| | | * Page to query the hms information of the device. |
| | | * 查询设备hms信息的页面。/{workspace_id},@PathVariable("workspace_id") String workspaceId |
| | | * @param param |
| | | * @param workspaceId |
| | | * @return |
| | | */ |
| | | @GetMapping("/{workspace_id}/devices/hms") |
| | | public ResponseResult<PaginationData<DeviceHmsDTO>> getHmsInformation(DeviceHmsQueryParam param, |
| | | @PathVariable("workspace_id") String workspaceId) { |
| | | @Operation(summary = "获取设备HMS信息", description = "参数传空则忽略该条件,返回所有符合其他条件的数据") |
| | | @ApiOperation("获取设备HMS信息") |
| | | @GetMapping("/devices/hms") |
| | | public ResponseResult<PaginationData<DeviceHmsDTO>> getHmsInformation(DeviceHmsQueryParam param) { |
| | | if (param == null) { |
| | | param = new DeviceHmsQueryParam(); |
| | | } |
| | | PaginationData<DeviceHmsDTO> devices = deviceHmsService.getDeviceHmsByParam(param); |
| | | |
| | | return ResponseResult.success(devices); |
| | |
| | | * @param deviceSn |
| | | * @return |
| | | */ |
| | | @PutMapping("/{workspace_id}/devices/hms/{device_sn}") |
| | | @ApiOperation("更新HMS消息为已读状态") |
| | | @PutMapping("/devices/hms/{device_sn}") |
| | | public ResponseResult updateReadHmsByDeviceSn(@PathVariable("device_sn") String deviceSn) { |
| | | deviceHmsService.updateUnreadHms(deviceSn); |
| | | return ResponseResult.success(); |
| | |
| | | * @param deviceSn |
| | | * @return |
| | | */ |
| | | @GetMapping("/{workspace_id}/devices/hms/{device_sn}") |
| | | @ApiOperation("获取设备未读HMS消息") |
| | | @GetMapping("/devices/hms/{device_sn}") |
| | | public ResponseResult<List<DeviceHmsDTO>> getUnreadHmsByDeviceSn(@PathVariable("device_sn") String deviceSn) { |
| | | PaginationData<DeviceHmsDTO> paginationData = deviceHmsService.getDeviceHmsByParam( |
| | | DeviceHmsQueryParam.builder() |