| | |
| | | taoBaoShopDTO.setSellerId(item.optLong("seller_id"));
|
| | | taoBaoShopDTO.setBrandId(item.optString("brand_id"));
|
| | | taoBaoShopDTO.setBrandDes(item.optString("brand_des"));
|
| | | taoBaoShopDTO.setShopIcon(item.optString("brand_logo"));
|
| | | taoBaoShopDTO.setUserType(0);
|
| | |
|
| | | // 商品信息
|
| | |
| | | public static int RANK_TYPE_TIME = 1;// 实时
|
| | | public static int RANK_TYPE_DAY = 2;// 全天榜
|
| | | public static int RANK_TYPE_HOT = 3;// 热推榜
|
| | | public static int RANK_TYPE_REBUY = 4;// 复购榜
|
| | |
|
| | | /**
|
| | | * 各大榜单
|
| | |
| | | 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<>());
|
| | | // 做2次请求
|
| | | String result = null;
|
| | | try {
|
| | | result = HttpUtil.get("https://openapi.dataoke.com/api/goods/get-ranking-list", params, new HashMap<>());
|
| | | } catch (Exception e) {
|
| | | result = HttpUtil.get("https://openapi.dataoke.com/api/goods/get-ranking-list", params, new HashMap<>());
|
| | | }
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | if (json != null) {
|
| | | JSONArray array = json.optJSONArray("data");
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 各大榜单
|
| | | * |
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public static String getHotWords() {
|
| | | TaoKeAppInfo app = getRandomApp();
|
| | | Map<String, String> params = new TreeMap<>();
|
| | | params.put("version", "v1.0.1");
|
| | | params.put("appKey", app.getAppKey());
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | | |
| | | String result = null;
|
| | | try {
|
| | | result = HttpUtil.get("https://openapi.dataoke.com/api/category/get-top100", params, new HashMap<>());
|
| | | } catch (Exception e) {
|
| | | result = HttpUtil.get("https://openapi.dataoke.com/api/category/get-top100", params, new HashMap<>());
|
| | | }
|
| | | |
| | | String hotWords = null;
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | if (json != null) {
|
| | | json = json.getJSONObject("data");
|
| | | if (json != null) {
|
| | | hotWords = json.optString("hotWords");
|
| | | }
|
| | | }
|
| | | return hotWords;
|
| | | }
|
| | | |
| | | |
| | | class DaTaoKeResult {
|
| | | Date updateTime;
|
| | | List<DaTaoKeDetail> dataList;
|
| | |
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | }
|