package com.hdl.photovoltaic.config;
|
|
import com.hdl.photovoltaic.BuildConfig;
|
|
/**
|
* 初始化App配置数据
|
*/
|
public class AppConfigManage {
|
|
/*********是否正式服务器*********/
|
private static final boolean isOnlineServer = false;
|
/*********正式环境*********/
|
private static final String APP_KEY_ONLINE = "CSZEMDJL";
|
private static final String APP_SECRET_ONLINE = "CSZEMDKBCSZEMDKR";
|
private static final String APP_REGIONURL_ONLINE = "https://nearest.hdlcontrol.com";
|
|
/*********测试环境*********/
|
private static final String APP_KEY_TEST = "CTBGMNUV";
|
private static final String APP_SECRET_TEST = "CTBGMNVLCTBGMNWB";
|
private static final String APP_REGIONURL_TEST = "https://test-gz.hdlcontrol.com";
|
|
|
/*********获取当前是否使用正式服务器环境*********/
|
public static boolean isIsOnlineServer() {
|
return isOnlineServer;
|
}
|
|
/// 用户注册所在服务器域名地址(用户请求网络用的)
|
private static String sUserRegionUrl;
|
|
public static String getUserRegionUrl() {
|
return sUserRegionUrl == null ? "" : sUserRegionUrl;
|
}
|
|
public static void setUserRegionUrl(String userRegionUrl) {
|
sUserRegionUrl = userRegionUrl;
|
}
|
|
/*********getAppKey*********/
|
public static String getAppKey() {
|
if (isOnlineServer) {
|
return APP_KEY_ONLINE;
|
} else {
|
return APP_KEY_TEST;
|
}
|
}
|
|
/*********getAppSecret*********/
|
public static String getAppSecret() {
|
if (isOnlineServer) {
|
return APP_SECRET_ONLINE;
|
} else {
|
return APP_SECRET_TEST;
|
}
|
}
|
|
/*********getAPP_RegionUrl*********/
|
public static String getAPPRegionUrl() {
|
if (isOnlineServer) {
|
return APP_REGIONURL_ONLINE;
|
} else {
|
return APP_REGIONURL_TEST;
|
}
|
}
|
|
/**
|
* 当前是否为调试模式
|
*/
|
public static boolean isDebug() {
|
return BuildConfig.DEBUG;
|
}
|
|
/**
|
* 获取当前应用的版本名
|
*/
|
public static String getVersionName() {
|
return BuildConfig.VERSION_NAME;
|
}
|
}
|