package com.its.pis.config;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Slf4j
@Getter
@Setter
@ToString
@Configuration
@ConfigurationProperties(prefix = "application.facility-manager")
public class FacilityManagerConfig {

    private boolean enable = true;
    private String ipAddr = "";
    private int sendPort = 5701;
    private int recvPort = 5202;

    @PostConstruct
    private void init() {
        if (this.ipAddr.equals(""))
            this.enable = false;
        log.info("{}", this);
    }

}
