package com.xhkjedu.sstudy.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author ywx
 * @classname ConfigKey
 * @description 读取配置文件类
 * @date 2020/10/16 9:19
 **/
@Component
public class ConfigKey {

    public static Integer nummin;
    public static Integer nummax;
    public static Long numadd;

    @Value("${nummin}")
    public void setNummin(Integer nummin) {
        ConfigKey.nummin = nummin;
    }

    @Value("${nummax}")
    public void setNummax(Integer nummax) {
        ConfigKey.nummax = nummax;
    }

    @Value("${numadd}")
    public void setNumadd(Long numadd) {
        ConfigKey.numadd = numadd;
    }

    public static String cloudapi;//云平台接口
    public static String showurl;//文件访问路径
    public static String oldshowurl;//原文件访问路径
    public static String fileapi;//文件服务接口地址
    public static String dbname;//数据库名

    @Value("${cloudapi}")
    public void setCloudapi(String cloudapi) {
        this.cloudapi = cloudapi;
    }

    @Value("${file.showurl}")
    public void setShowurl(String showurl) {
        this.showurl = showurl;
    }

    @Value("${file.oldshowurl}")
    public void setOldshowurl(String oldshowurl) {
        this.oldshowurl = oldshowurl;
    }

    @Value("${fileapi}")
    public void setFileapi(String fileapi) {
        this.fileapi = fileapi;
    }

    @Value("${dbname}")
    public void setDbname(String dbname) {
        ConfigKey.dbname = dbname;
    }

    public static Integer buildnum;//构建号

    @Value("${buildnum}")
    public void setBuildnum(Integer buildnum){
        this.buildnum = buildnum;
    }

    public static String ipregiondb;//解析ip地址归属地

    @Value("${ipregiondb}")
    public void setIpregiondb(String ipregiondb){
        ConfigKey.ipregiondb = ipregiondb;
    }
}
