From 7becc97c5bfdd827b9a999c26746bb8e8bc3e25c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 13 三月 2021 16:23:36 +0800 Subject: [PATCH] 后台会员/会员订单查询,搜索结果高清标签添加, --- src/main/java/com/yeshi/buwan/pptv/PPTVApiUtil.java | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/pptv/PPTVApiUtil.java b/src/main/java/com/yeshi/buwan/pptv/PPTVApiUtil.java index 76f9c4e..20dd816 100644 --- a/src/main/java/com/yeshi/buwan/pptv/PPTVApiUtil.java +++ b/src/main/java/com/yeshi/buwan/pptv/PPTVApiUtil.java @@ -4,6 +4,7 @@ import com.yeshi.buwan.pptv.entity.PPTVSeries; import com.yeshi.buwan.util.StringUtil; import com.yeshi.buwan.util.TimeUtil; +import com.yeshi.buwan.util.log.LoggerUtil; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.commons.httpclient.HttpClient; @@ -161,7 +162,7 @@ Map<String, String> params = new HashMap<>(); params.put("uid", uid); // String result = baseRequest("https://coapi.pptv.com/coapi-web/api/http/sopRequest", params, "pptv.channel.openid.get"); - String result = baseRequest("http://coapiwebsit.cnsuning.com/coapi-web/api/http/sopRequest", params, "pptv.channel.openid.get"); + String result = baseRequest("https://coapi.pptv.com/coapi-web/api/http/sopRequest", params, "pptv.channel.openid.get"); System.out.println(result); JSONObject resultJSON = JSONObject.fromObject(result); JSONObject response = resultJSON.optJSONObject("response"); @@ -184,7 +185,7 @@ * @param code */ public static boolean login(String code) { - String url = String.format("https://coapi.pptv.com/coapi-web/api/getUserToken/%s/%s.htm", APP_KEY, code); + String url = String.format("https://coapi.pptv.com/coapi-web/api/getUserToken/%s/%s.htm", APP_KEY,URLEncoder.encode(code)); String result = HttpUtil.get(url); System.out.println(result); JSONObject resultJSON = JSONObject.fromObject(result); @@ -204,13 +205,14 @@ public static boolean buyGoods(String openId, String orderNo, String goodsNo, Date orderTime) { Map<String, String> params = new HashMap<>(); params.put("openId", openId); - params.put("canal", "253350"); + params.put("canal", CHANNEL_ID); params.put("channel", "yeshi"); params.put("goodsNo", goodsNo); params.put("outOrderId", orderNo); params.put("orderTime", TimeUtil.getGernalTime(orderTime.getTime(), "yyyy-MM-dd HH:mm:ss")); params.put("sign", StringUtil.Md5(String.format("%s&%s&%s&%s", openId, params.get("channel"), orderNo, "2MnD8nCWu7EzbiJ"))); - String result = get("http://uc.test.pptv.com/cusp/jointMember", params); + String result = get("http://billing.api.pptv.com/cusp/jointMember", params); + LoggerUtil.getVIPLogger().info("寮�閫氫細鍛�-璁㈠崟鍙凤細{},缁撴灉锛歿}", orderNo, result); System.out.println(result); JSONObject data = JSONObject.fromObject(result); if (data.optInt("errorCode") == 0) { @@ -231,8 +233,8 @@ } public static void main(String[] args) { - // - buyGoods("257dfd950c20ad25dee9f99ef926c0f8", "buwan_29", "DA7559531560894", new Date()); + //DA7559531560894 + buyGoods("257dfd950c20ad25dee9f99ef926c0f8", "buwan_100", "DA7559531560894", new Date()); } -- Gitblit v1.8.0