package org.wcs.serve.controller.pub;

import jakarta.validation.constraints.NotBlank;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.wcs.model.vo.pub.PubServeDataResponse;
import org.wcs.model.vo.pub.deveice.ConveyStatusVo;
import org.wcs.serve.service.pub.intf.IDeviceService;

/**
 * 对外开放的设备的相关控制器
 */
@RestController
@RequestMapping("/api/pub/device")
@ResponseBody
@RequiredArgsConstructor
public class DeviceController {

    private final IDeviceService deviceService;

    /**
     * 获取输送设备状态
     * @param conveyNo 输送编号
     * @return 响应
     */
    @GetMapping("getConveyStatus")
    public PubServeDataResponse<ConveyStatusVo> queryConveyStatus(@RequestParam("conveyId") @NotBlank(message = "输送设备号不允许为空") String conveyNo) {
        return deviceService.queryConveyStatus(conveyNo);
    }

}
