AppProperties.java 1.25 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 String scheduleDataUrl;

    private static String scheduleSecret;

    private static String gpsDataUrl;

    private static int cacheDays;

    public static String getScheduleDataUrl() {
        return scheduleDataUrl;
    }

    @Value("${http.control.service_data_url}")
    public void setScheduleDataUrl(String scheduleDataUrl) {
        AppProperties.scheduleDataUrl = scheduleDataUrl;
    }

    public static String getScheduleSecret() {
        return scheduleSecret;
    }

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

    public static String getGpsDataUrl() {
        return gpsDataUrl;
    }

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

    public static int getCacheDays() {
        return cacheDays;
    }

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