package com.xt.hb.gis.common;

import org.slf4j.helpers.FormattingTuple;
import org.slf4j.helpers.MessageFormatter;

import com.alibaba.fastjson.JSONObject;

/**
 * 数据接口全局参数
 * 
 * @author 袁晓冬
 *
 */
public class DataServerGlobal {
	/** 服务IP */
	public static String SERVER_URL = "";
	private static final String MESSAGE_PATTERN = "http://%s%s";

	public static void initServices(JSONObject serverInfo) {
		GKGQQY_URL = String.format(MESSAGE_PATTERN, SERVER_URL, serverInfo.get("gkgqjryTree"));
		SP_URL = String.format(MESSAGE_PATTERN, SERVER_URL, serverInfo.get("cameraTree"));
		SINGlE_GQ_URL = String.format(MESSAGE_PATTERN, SERVER_URL, serverInfo.get("gq"));
		SINGlE_MT_URL = String.format(MESSAGE_PATTERN, SERVER_URL, serverInfo.get("mt"));
		SINGlE_BW_URL = String.format(MESSAGE_PATTERN, SERVER_URL, serverInfo.get("bw"));
		SINGlE_JYR_URL = String.format(MESSAGE_PATTERN, SERVER_URL, serverInfo.get("jyr"));
		SINGlE_QSK_URL = String.format(MESSAGE_PATTERN, SERVER_URL, serverInfo.get("qsk"));
		SINGlE_CBYJ_URL = String.format(MESSAGE_PATTERN, SERVER_URL, serverInfo.get("cbyjArea"));
		BW_PAGE_URL = String.format(MESSAGE_PATTERN, SERVER_URL, serverInfo.get("bwPage"));
		SHIPNAME_URL = String.format(MESSAGE_PATTERN, SERVER_URL, serverInfo.get("shipName"));
		System.out.println("港口港区企业树服务地址(GKGQQY_URL):" + GKGQQY_URL);
		System.out.println("视频树服务地址(SP_URL):" + SP_URL);
		System.out.println("港区服务地址(SINGlE_GQ_URL):" + SINGlE_GQ_URL);
		System.out.println("码头服务地址(SINGlE_MT_URL):" + SINGlE_MT_URL);
		System.out.println("泊位服务地址(SINGlE_BW_URL):" + SINGlE_BW_URL);
		System.out.println("经营人服务地址(SINGlE_JYR_URL):" + SINGlE_JYR_URL);
		System.out.println("取水口服务地址(SINGlE_QSK_URL):" + SINGlE_QSK_URL);
		System.out.println("船舶预警区域服务地址(SINGlE_CBYJ_URL):" + SINGlE_CBYJ_URL);
		System.out.println("泊位分页信息服务地址(BW_PAGE_URL):" + BW_PAGE_URL);
		System.out.println("船名接口信息服务地址(SHIPNAME_URL):" + SHIPNAME_URL);
	}

	/** 港口港区企业树服务地址 */
	public static String GKGQQY_URL;
	/** 视频树服务地址 */
	public static String SP_URL;
	/** 港区服务地址 */
	public static String SINGlE_GQ_URL;
	/** 码头服务地址 */
	public static String SINGlE_MT_URL;
	/** 泊位服务地址 */
	public static String SINGlE_BW_URL;
	/** 经营人服务地址 */
	public static String SINGlE_JYR_URL;
	/** 取水口服务地址 */
	public static String SINGlE_QSK_URL;
	/** 船舶预警区域服务地址 */
	public static String SINGlE_CBYJ_URL;

	/** 泊位分页信息服务地址 */
	public static String BW_PAGE_URL;
	/** 获取船名接口 */
	public static String SHIPNAME_URL;
}
