package egovframework.com.its.web.server.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;
import java.text.SimpleDateFormat;
import java.util.Date;

@Slf4j
@Getter
@Setter
@ToString
@Configuration
@ConfigurationProperties(prefix = "application.process")
public class ApplicationConfig {

    private String bootingDateTime;
    private boolean startSchedule;

    private String id = "OPER00";
    private String name = "ITS Web Server";

    private String centerId = "L08";
    private String regionCode = "214";
    private String regionName = "평택시";

    @PostConstruct
    private void init() {
        this.startSchedule = false;
        SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date dtLog = new Date();
        this.bootingDateTime = sdfDate.format(dtLog);
        log.info("{}", this);
    }

}
