package com.muyu.web.domain.model;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
    Mqtt服务器模型
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class MqttServerModel {
    private static final Logger log=LoggerFactory.getLogger(MqttServerModel.class);

    /**
     * MQTT服务节点
     */
    private String broker;

    /**
     * MQTT订阅主题
     */
    private String topic;

    public String getBroker(){
        log.info("broker:{}",broker);
        return broker.contains("tcp://")?broker:"tcp://"+broker+":1883";
    }


}

