PushCommon.java 1.9 KB
package com.glsx.pushsdk.common;

public class PushCommon {

    /**
     * 是否为测试环境的开关
     */
    public static boolean isRelease_V = true;

    /**
     * 用于判断是否为测试服务器还是开发服务器连接
     */
    private static boolean loginFlag = true;

    /**
     * 业务服务器url
     */
    public static String BUSSI_SVR_URL = "";
    /**
     * 业务服务器端口
     */
    public static int BUSSI_SVR_port = 0;


    /**
     * 接收服务器url
     */
    public static String ACCESS_SVR_URL = "http://192.168.0.90";
    /**
     * 接收服务器端口
     */
    public static int ACCESS_SVR_port = 20010;

    /**
     * 服务链接请求超时时间 10s
     */
    public static int OUT_TIME = 30 * 1000;

    /**
     * 心跳包请求30s发送一次
     */
    public static int HEART_REQUEST_TIME = 30;

    // 静态初始化数据
    static {
        if (isRelease_V) {// 正式环境
            //ACCESS_SVR_URL = "http://14.17.102.198";//push.didihu.com.cn
            //ACCESS_SVR_URL = "http://push.didihu.com.cn";
            ACCESS_SVR_URL = "https://push.didihu.com.cn";
            ACCESS_SVR_port = 20010;
        } else {
            if (loginFlag) {// 测试环境

                //ACCESS_SVR_URL = "http://14.17.96.50";//push.test.didihu.com.cn
                ACCESS_SVR_URL = "https://push.test.didihu.com.cn";
                //Common.ACCESS_SVR_URL = "http://192.168.3.153";//接入新布一套测试环境
                ACCESS_SVR_port = 20010;

            } else { // 开发环境

                ACCESS_SVR_URL = "https://push.test.didihu.com.cn";
                //ACCESS_SVR_URL = "http://192.168.0.90";
                ACCESS_SVR_port = 20010;
            }
        }
    }

    /**
     * 设置业务服务器IP和端口置空
     */
    public static void setPortIsEmpty() {
        BUSSI_SVR_URL = "";
        BUSSI_SVR_port = 0;
    }

}