| | |
| | | package com.ks.lijin.utils.taobao; |
| | | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.ks.lijin.exception.*; |
| | | import com.ks.lijin.pojo.DTO.taobao.*; |
| | | import com.ks.lijin.pojo.PageEntity; |
| | |
| | | } catch (LiJinException e) { |
| | | throw e; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 淘礼金报告 |
| | | * |
| | | * @param rightsId |
| | | * @param app |
| | | * @return |
| | | * @throws LiJinAccountException |
| | | * @throws LiJinAmountException |
| | | * @throws LiJinException |
| | | * @throws LiJinGoodsException |
| | | */ |
| | | public static TaoLiJinReportDTO taolijinReport(String rightsId, TaoKeAppInfo app) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.dg.vegas.tlj.instance.report"); |
| | | map.put("rights_id", rightsId); |
| | | |
| | | String result = baseRequestForThreeTimes(map, app); |
| | | JSONObject json = JSONObject.fromObject(result); |
| | | System.out.println(json); |
| | | JSONObject root = json.optJSONObject("tbk_dg_vegas_tlj_instance_report_response"); |
| | | if (root != null && root.optJSONObject("result") != null) { |
| | | if (root.optJSONObject("result").optBoolean("success")) { |
| | | JSONObject modelJson = root.optJSONObject("result").optJSONObject("model"); |
| | | TaoLiJinReportDTO dto = new Gson().fromJson(modelJson.toString(), TaoLiJinReportDTO.class); |
| | | return dto; |
| | | } else { |
| | | // 日志记录 TODO |
| | | } |
| | | } |
| | | |
| | | |
| | | return null; |
| | | } |
| | |
| | | return goods; |
| | | } |
| | | |
| | | public static Date getTaoBaoSystemTime() { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.time.get"); |
| | | try { |
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map, false); |
| | | String time = json.optJSONObject("time_get_response").optString("time"); |
| | | return new Date(TimeUtil.convertToTimeTemp(time, "yyyy-MM-dd HH:mm:ss")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | taolijinReport("eC2%2FoV8gigdzVO5CvuRDjDVC0SEP1L7d",new TaoKeAppInfo("27743325","527a23554f71557d7b786bc479fcd5fe")); |
| | | } |
| | | |
| | | } |
| | | |
| | | |