資源簡介
微信公眾號自定義菜單
代碼片段和文件信息
/**
?*?Description:?多森56gate物流平臺
?*?文件名:JSONBean.java
?*?版本信息:1.0
?*?日期:2013-10-23
?*?Copyright?深圳市多森軟件開發有限公司?Copyright?(c)?2013
?*?版權所有
?*/
package?com.duosen.dsocs.wechat.action;
import?java.io.BufferedReader;
import?java.io.IOException;
import?java.io.InputStreamReader;
import?java.net.HttpURLConnection;
import?java.net.MalformedURLException;
import?java.net.URL;
import?java.security.cert.CertificateException;
import?java.security.cert.X509Certificate;
import?java.util.ArrayList;
import?java.util.List;
import?javax.net.ssl.HostnameVerifier;
import?javax.net.ssl.HttpsURLConnection;
import?javax.net.ssl.SSLContext;
import?javax.net.ssl.SSLSession;
import?javax.net.ssl.TrustManager;
import?javax.net.ssl.X509TrustManager;
import?org.json.JSONException;
import?com.duosen.dsocs.wechat.domain.EventJSONBean;
import?com.duosen.dsocs.wechat.domain.JSONBean;
import?com.duosen.dsocs.wechat.utils.WeixinUtil;
import?net.sf.json.JSONArray;
import?net.sf.json.JSONobject;
/**
?*?@項目名稱:56gateServer
?*?@類名稱:JSONBean
?*?@類描述:
?*?@創建人:zxt
?*?@創建時間:2013-10-23?下午02:14:54
?*?@修改人:zxt
?*?@修改時間:2013-10-23?下午02:14:54
?*?@修改備注:
?*?@version?1.0
?*/
@SuppressWarnings(“unused“)
public?class?Wxmenu?{
private?static?String?access_token?=?““;
private?static?List?list?=?new?ArrayList();
private?static?JSONobject?menu=?new?JSONobject();?
private?static?String?params;
private?static?String?msg;
//構造菜單
static{
List?oneMenu?=?new?ArrayList();
oneMenu.add(new?JSONBean(“立即打車“?“view“?“https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7100db9d200ff070&redirect_uri=http://taxiocs.21letu.com/wechat/jsp/call.jsp?type=1&response_type=code&scope=snsapi_base#wechat_redirect“));
JSONobject?oneJSONobject?=?new?JSONobject();
oneJSONobject.put(“name“?“打車“);
oneJSONobject.put(“sub_button“?oneMenu);
list.add(oneJSONobject);
List?twoMenu?=?new?ArrayList();
twoMenu.add(new?JSONBean(“用車記錄“?“view“?“https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7100db9d200ff070&redirect_uri=http://taxiocs.21letu.com/wechatapi/getOrderList.action?orderInfo.pay=0&response_type=code&scope=snsapi_base#wechat_redirect“));
JSONobject?twoJSONobject?=?new?JSONobject();
twoJSONobject.put(“name“?“我的樂嘀“);
twoJSONobject.put(“sub_button“?twoMenu);
list.add(twoJSONobject);
List?threeMenu?=?new?ArrayList();
threeMenu.add(new?JSONBean(“樂嘀APP下載“?“view“?“http://taxiocs.21letu.com/appdownload.jsp“));
JSONobject?threeJSONobject?=?new?JSONobject();
threeJSONobject.put(“name“?“樂嘀服務“);
threeJSONobject.put(“sub_button“?threeMenu);
list.add(threeJSONobject);
menu.put(“button“?list);
params?=?menu.toString();
System.out.println(“static“+menu);
}
private?static?class?TrustAnyTrustManager?implements?X509TrustManager?{
public?void?checkClientTrusted(X509Certificate[]?chain?String?authType)?throws?Certif
評論
共有 條評論