From 26e7a03ee4be4b8de0cbfe55d6ef6a63122b2336 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 02 八月 2019 16:00:33 +0800
Subject: [PATCH] 暂不到账拼多多/京东
---
fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java
index 4c81d5f..12a6081 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java
@@ -30,7 +30,6 @@
import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
-import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
@@ -120,6 +119,14 @@
resultJson.optJSONObject("data").optString("update_time"), list);
}
+ public static DaTaoKeDetail getGoodsDetailV1(Long id) {
+ String url = String.format("http://api.dataoke.com/index.php?r=Port/index&type=total&appkey=%s&v=2&id=%s",
+ Math.random() > 0.5 ? API_KEY : API_KEY_2, id + "");
+ String result = request(url);
+ JSONObject resultJson = JSONObject.fromObject(result);
+ return gson.fromJson(resultJson.optJSONArray("result").optJSONObject(0).toString(), DaTaoKeDetail.class);
+ }
+
/**
* 鑾峰彇澶ф窐瀹㈠搧鐗屼紭閫� 鍝佺墝id
*
@@ -168,10 +175,10 @@
taoBaoShopDTO.setBrandId(item.optString("brand_id"));
taoBaoShopDTO.setBrandDes(item.optString("brand_des"));
taoBaoShopDTO.setUserType(0);
-
+
// 鍟嗗搧淇℃伅
taoBaoShopDTO = getDynamicShopGoods(brandId, taoBaoShopDTO);
-
+
break;
}
}
@@ -418,7 +425,6 @@
return StringUtil.Md5(signStr).toUpperCase();
}
-
/**
* 鑾峰彇搴楅摵涓嬪墠4涓晢鍝併�佸簵閾轰粙缁�
*
@@ -429,20 +435,20 @@
if (brandId == null) {
return taoBaoShopDTO;
}
-
+
int userType = 0;
List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
-
- String result = HttpUtil.get("http://www.dataoke.com/brandGoods?id=" + brandId +"&page=1");
+
+ String result = HttpUtil.get("http://www.dataoke.com/brandGoods?id=" + brandId + "&page=1");
JSONObject json = JSONObject.fromObject(result);
JSONArray arrayGoods = json.optJSONArray("goods");
-
+
for (int i = 0; i < arrayGoods.size(); i++) {
if (i >= 2) {
break;
}
JSONObject itemGoods = arrayGoods.optJSONObject(i);
-
+
TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief();
taoBaoGoods.setAuctionId(itemGoods.optLong("goodsid"));
taoBaoGoods.setBiz30day(itemGoods.optInt("xiaoliang"));
@@ -471,7 +477,6 @@
taoBaoShopDTO.setListGoods(listGoods);
return taoBaoShopDTO;
}
-
public static int RANK_TYPE_TIME = 1;// 瀹炴椂
public static int RANK_TYPE_DAY = 2;// 鍏ㄥぉ姒�
@@ -483,16 +488,17 @@
* @param type
* @return
*/
- public static DaTaoKeGoodsResult getRankingList(int type) {
+ public static DaTaoKeGoodsResult getRankingList(int type, Integer cid) {
TaoKeAppInfo app = getRandomApp();
DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
Map<String, String> params = new TreeMap<>();
params.put("version", "v1.0.0");
params.put("appKey", app.getAppKey());
params.put("rankType", type + "");
+ if (cid != null)
+ params.put("cid", cid + "");
params.put("sign", getSign(params, app.getAppSecret()));
String result = HttpUtil.get("https://openapi.dataoke.com/api/goods/get-ranking-list", params, new HashMap<>());
- LogHelper.test("getRankingList:" + result);
JSONObject json = JSONObject.fromObject(result);
if (json != null) {
JSONArray array = json.optJSONArray("data");
--
Gitblit v1.8.0