package com.tsi.comm.server.config;

import com.tsi.app.common.utils.TimeUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

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

    private String processId = "tsi-comm-server";
    private double cpuLimits = 75;
    private String bootingTime;
    private boolean startSchedule;

    @PostConstruct
    private void init() {
        this.startSchedule = false;
        this.bootingTime = TimeUtils.now();

        log.info("[{}] -------------------------", this.getClass().getSimpleName());
        log.info("[{}]         processId: {}", this.getClass().getSimpleName(), this.processId);
        log.info("[{}]         cpuLimits: {}", this.getClass().getSimpleName(), this.cpuLimits);
    }

}
