package com.muyu.car.domain.model.properties;

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

/**
 * @Author：蓬叁
 * @Package：com.muyu.car.domain.model.properties
 * @Project：cloud-server-8
 * @name：MqttServerModel
 * @Date：2024/10/6 下午8:25
 */
@Data
@Builder
@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";
    }

}
