package com.jysoft.weChat.util; import java.util.Map; public class InterfaceUtil { public static final String ip="http://59.110.214.102:6501"; public static final String sessionStr="dXNyaWQ9NjQ0YTE4ZGUtMThlMC00YmY0LWJiNDUtOGQ4MmExNzc1ZDIwJmxldmVsPTEmdGltZT0yMDE5LTExLTAzIDE4OjE4OjI3"; /* public static Properties getProperties() throws IOException{ Properties pro=new Properties(); String path =InterfaceUtil.class.getResource("test.properties").getPath(); InputStream input=new FileInputStream(path); pro.load(input); return pro; }*/ //拼接请求的url public static Map makeUrlAndResult(String mapping,String paramname,String value) throws Exception{ StringBuffer url=new StringBuffer(); url.append(ip+mapping); url.append("?sessionID="); url.append(sessionStr); url.append("&"); url.append(paramname); url.append("="); url.append(value); String result=url.toString(); Map map=null; try { map=HttpUtilComputer.getResult(result); } catch (Exception e) { System.out.println(e.getMessage()); } return map; } //拼接请求的url public static Map makeUrlAndResult(String mapping) throws Exception{ StringBuffer url=new StringBuffer(); url.append(ip+mapping); url.append("?sessionID="); url.append(sessionStr); String result=url.toString(); Map map=HttpUtilComputer.getResult(result); return map; } }