package com.inspect.metadata.mqtt;

import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Data
@Component
@ConfigurationProperties(prefix = "hua-ruan.mqtt")
@ConditionalOnProperty(
        name = {"hua-ruan.mqtt.enable"},
        havingValue = "true"
)
public class MqttProperties {
    /** MQTT Broker IP */
    private String ip = "localhost";

    /** MQTT Broker Port */
    private int port = 1883;

    /** 客户端 ID */
    private String clientId = "test";

    /** 用户名 */
    private String user = "admin";

    /** 密码 */
    private String pwd = "123456";

    /** 订阅的 topic 列表 */
    private String[] topicFilters = new String[0];

    /** QoS 数组 */
    private int[] qos = new int[]{1};
}
