package com.zd.laboratory.event;

import com.zd.laboratory.mqtt.constants.MqttConstants;
import com.zd.laboratory.mqtt.entiy.MessageBody;
import com.zd.system.api.laboratory.domain.SensorFunctionStatus;
import com.zd.system.api.laboratory.domain.vo.SubFunction;
import org.springframework.stereotype.Component;

/**
 * Controller
 * 不在使用因为现在mttq 没法产生主题得竞争，导致多个服务都会执行
 * @author cyl
 * @date 2021/10/14
 */

@Component
public class SensorLabMessageEvent extends LabMessageEvent<SubFunction<SensorFunctionStatus>> {


    public SensorLabMessageEvent() {
        super(SensorLabMessageEvent.class);
    }
    public SensorLabMessageEvent(Object source) {
        super(source);
    }

    @Override
    public LabMessageEvent createNew() {
        SensorLabMessageEvent sensorLabMessageEvent = new SensorLabMessageEvent(SensorLabMessageEvent.class);
        return sensorLabMessageEvent;
    }

    @Override
    public  String topic() {
        return MqttConstants.LAB_FUNCTION_DATA;
    }
}
