package com.railway.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * 全局配置类
 *
 * @author railway
 */
@Data
@Component
@ConfigurationProperties(prefix = "railway")
public class RailwayConfig {

  /**
   * 项目名称
   */
  private String name;

  /**
   * 版本
   */
  private String version;

  /**
   * 版权年份
   */
  private String copyrightYear;

  /**
   * 实例演示开关
   */
  private boolean demoEnabled;

  private static String filePath;

  /**
   * 获取地址开关
   */
  private static boolean addressEnabled;

  public static boolean isAddressEnabled() {
    return addressEnabled;
  }

  public void setAddressEnabled(boolean addressEnabled) {
    RailwayConfig.addressEnabled = addressEnabled;
  }

  public static String getFilePath() {
    return filePath;
  }

  public void setFilePath(String filePath){
    RailwayConfig.filePath = filePath;
  }
}
