package com.xy.service;

import com.xy.annotate.RestMappingController;
import com.xy.dto.DeviceMqttDto;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 设备消费者 接口
 */
@RestMappingController("device-mqtt-consumer")
public interface DeviceMqttConsumer {

    /**
     * 设备在线
     *
     * @param requestParams
     */
    @PostMapping("connected")
    void connected(@RequestBody @Validated DeviceMqttDto.RequestParams requestParams);

    /**
     * 设备离线
     *
     * @param requestParams
     */
    @PostMapping("disconnect")
    void disconnect(@RequestBody @Validated DeviceMqttDto.RequestParams requestParams);

    /**
     * 设备消息推送
     *
     * @param requestParams
     */
    @PostMapping("devicePushMsg")
    void devicePushMsg(@RequestBody @Validated DeviceMqttDto.RequestParams requestParams);

    @PostMapping("deviceFault")
    void deviceFault(@RequestBody @Validated DeviceMqttDto.RequestParams requestParams);

}
