AppProperties.java 1.14 KB
package com.bsth.util;

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

/**
 * @author Hill
 */
@Component
public class AppProperties {

    private static int cacheDays;

    private static String controlUrl;

    private static String secretKey;

    private static String gpsUrl;

    @Value("${cache.days}")
    public void setCacheDays(int cacheDays) {
        AppProperties.cacheDays = cacheDays;
    }

    public static int getCacheDays() {
        return cacheDays;
    }

    @Value("${http.control.service_data_url}")
    public void setControlUrl(String url) {
        AppProperties.controlUrl = url;
    }

    public static String getControlUrl() {
        return controlUrl;
    }

    @Value("${http.control.secret.key}")
    public void setSecretKey(String secretKey) {
        AppProperties.secretKey = secretKey;
    }

    public static String getSecretKey() {
        return secretKey;
    }

    @Value("${http.gps.real.url}")
    public void setGpsUrl(String url) {
        AppProperties.gpsUrl = url;
    }

    public static String getGpsUrl() {
        return gpsUrl;
    }
}