| | |
| | | package com.yeshi.fanli.util;
|
| | |
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.net.URLEncoder;
|
| | | import java.util.Iterator;
|
| | |
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | public class JumpDetailUtil {
|
| | | /**
|
| | |
| | | * @param params
|
| | | * @return
|
| | | */
|
| | | public static JumpDetailV2 getWXMPJumDetail(JumpDetailV2 detail, JSONObject params) {
|
| | | String path = detail.getPath();
|
| | | if (params != null) {
|
| | | path += "?";
|
| | | for (Iterator<String> its = params.keys(); its.hasNext();) {
|
| | | String key = its.next();
|
| | | try {
|
| | | path += (key + "=" + URLEncoder.encode(params.optString(key), "UTF-8") + "&");
|
| | | } catch (UnsupportedEncodingException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | if (path.endsWith("&"))
|
| | | path = path.substring(0, path.length() - 1);
|
| | | JumpDetailV2 v2 = new JumpDetailV2();
|
| | | v2.setPath(path);
|
| | | v2.setType(detail.getType());
|
| | | return v2;
|
| | | public static JumpDetailV2 getWXMPJumDetail(JumpDetailV2 detail) {
|
| | | detail.setActivity(null);
|
| | | detail.setController(null);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | }
|