package com.lanyuanxiaoyao.service.zookeeper;

import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Zookeeper 配置
 *
 * @author ZhangJiacheng
 * @date 2023-05-04
 */
@ConfigurationProperties("connector.zookeeper")
@Component
public class ZookeeperConfiguration {
    private static final Logger logger = LoggerFactory.getLogger(ZookeeperConfiguration.class);

    private String connectUrl;

    @PostConstruct
    private void init() {
        logger.info("Configuration initial: {}", this);
    }

    public String getConnectUrl() {
        return connectUrl;
    }

    public void setConnectUrl(String connectUrl) {
        this.connectUrl = connectUrl;
    }

    @Override
    public String toString() {
        return "ZookeeperConfiguration{" +
                "connectUrl='" + connectUrl + '\'' +
                '}';
    }
}
