zhaowenyu
2026-02-04 e9ed3967943149839c061b0821f7274899ed5e98
ard-admin/src/main/java/com/ard/web/controller/sample/DeviceHmsController.java
@@ -5,6 +5,9 @@
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.*;
@@ -18,7 +21,7 @@
 * @version 1.1
 * @date 2022/7/7
 */
@Api(tags = "设备HMS管理")
@RestController
@Slf4j
@RequestMapping("/dock/devices")
@@ -28,14 +31,17 @@
    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);
@@ -46,7 +52,8 @@
     * @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();
@@ -57,7 +64,8 @@
     * @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()