From 1764c1784a4cf1a6afd25fcf1a0eef6187a84218 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 08 七月 2021 17:14:58 +0800 Subject: [PATCH] 1.1.3完善 --- app/src/main/java/com/tejia/lijin/app/ShoppingApi.java | 182 +++++++++++++++++++++++++++++---------------- 1 files changed, 116 insertions(+), 66 deletions(-) diff --git a/app/src/main/java/com/tejia/lijin/app/ShoppingApi.java b/app/src/main/java/com/tejia/lijin/app/ShoppingApi.java index 40c83b2..ff682d4 100644 --- a/app/src/main/java/com/tejia/lijin/app/ShoppingApi.java +++ b/app/src/main/java/com/tejia/lijin/app/ShoppingApi.java @@ -21,6 +21,7 @@ import com.tejia.lijin.app.util.clipboard.ClipboardUtil; import com.tejia.lijin.app.util.user.LoginAndInviteStatusUtil; import com.tejia.lijin.app.util.user.UserUtil; +import com.yeshi.push.entity.PushRomType; import org.apache.http.Header; import org.json.JSONArray; @@ -65,7 +66,7 @@ public static OkHttpClient mOkHttpClientSoon;//okHttpClient 瀹炰緥 - private final static String API_PACKAGE_NAME="com.youhuiquan.android"; + public final static String API_PACKAGE_NAME = "com.youhuiquan.android"; static { mOkHttpClient = new OkHttpClient.Builder() @@ -121,6 +122,10 @@ params.put("page", page); if (subId != null) params.put("subId", subId); + if (UserUtil.getUid(context) != null) { + params.put("uid", UserUtil.getUid(context) + ""); + } + commonPostWithFailture(context, BASE_URL2 + "hotsell/getList", params, handler); } @@ -140,23 +145,6 @@ commonPost(context, BASE_URL2 + "brand/getShopInfoV2", params, handler); } - - /** - * 鐢ㄦ埛鍗忚鎸夐挳鐩戝惉 - * - * @param context - * @param uid - * @param type 0-涓嶅悓鎰� 1-鍚屾剰 2-鍚屾剰-绐楀彛鍏抽棴 - * @param handler - */ - public static void userProtocolListener(Context context, Long uid, int type, BasicTextHttpResponseHandler handler) { - LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); - params.put("type", type + ""); - if (uid != null) { - params.put("uid", uid + ""); - } - commonPost(context, BASE_URL2 + "config/userProtocolListen", params, handler); - } /** * 鑾峰彇搴楅摵 瓒宠抗 /瓒宠抗鍒楄〃 @@ -243,7 +231,7 @@ LinkedHashMap<String, String> params = new LinkedHashMap<>(); if (uid != null) params.put("uid", uid + ""); - commonPostWithFailture(context, BASE_URL2 + "recommend/getRecommendIndex", params, handler); + commonPostWithFailture(context, BASE_URL2 + "recommend/getRecommendIndexTJ", params, handler); } /** @@ -259,6 +247,10 @@ if (!StringUtils.isEmpty(page)) params.put("page", page); params.put("goodsType", goodsType); + if (UserUtil.getUid(context) != null) { + params.put("uid", UserUtil.getUid(context) + ""); + } + commonPostWithFailture(context, BASE_URL2 + "recommend/getGoodList", params, handler); } @@ -371,7 +363,8 @@ public static void sendCircle(Context context, Long uid, String id, BasicTextHttpResponseHandler handler) { LinkedHashMap<String, String> params = new LinkedHashMap<>(); - params.put("uid", uid + ""); + if (uid != null) + params.put("uid", uid + ""); params.put("id", id + ""); commonPostWithFailture(context, BASE_URL2 + "user/cloud/sendCircle", params, handler); } @@ -391,7 +384,8 @@ if (!LoginAndInviteStatusUtil.acessNext(context, uid, true)) return; LinkedHashMap<String, String> params = new LinkedHashMap<>(); - params.put("uid", uid + ""); + if (uid != null) + params.put("uid", uid + ""); params.put("type", type + ""); params.put("id", id); if (goodsId != null) @@ -412,11 +406,47 @@ */ public static void evaluateCopyComment(Context context, Long uid, String id, String cid, BasicTextHttpResponseHandler handler) { LinkedHashMap<String, String> params = new LinkedHashMap<>(); - params.put("uid", uid + ""); + if (uid != null) + params.put("uid", uid + ""); params.put("cid", cid); params.put("id", id); commonPostWithFailture(context, BASE_URL2 + "dynamic/evaluateComment", params, handler); } + + + /** + * 澶嶅埗鎺ㄨ崘璇� + * + * @param context + * @param uid + * @param id + * @param handler + */ + public static void evaluateCopyRecommend(Context context, Long uid, String id, BasicTextHttpResponseHandler handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (uid != null) + params.put("uid", uid + ""); + params.put("id", id); + commonPostWithFailture(context, BASE_URL2 + "dynamic/evaluateCopyRecommend", params, handler); + } + + + /** + * 杞摼 + * + * @param context + * @param uid + * @param link + * @param handler + */ + public static void evaluateConvertLink(Context context, Long uid, String link, BasicTextHttpResponseHandler handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (uid != null) + params.put("uid", uid + ""); + params.put("link", link); + commonPostWithFailture(context, BASE_URL2 + "dynamic/convertLink", params, handler); + } + /** * 棣栭〉椤堕儴鍒嗙被鍒嗙被鏁版嵁 @@ -547,6 +577,9 @@ params.put("startprice", startprice); params.put("endprice", endprice); params.put("totalSales", totalSales); + if (UserUtil.getUid(context) != null) { + params.put("uid", UserUtil.getUid(context) + ""); + } commonPostWithFailture(context, BASE_URL2 + "class/getSubGoods", params, handler); } @@ -560,6 +593,9 @@ LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); params.put("gcid", key); params.put("page", page); + if (UserUtil.getUid(context) != null) { + params.put("uid", UserUtil.getUid(context) + ""); + } commonPostWithFailture(context, BASE_URL2 + "class/getClassGoods", params, handler); } @@ -668,6 +704,11 @@ if (type != null && !type.equals("") && !type.equals("null") && !type.equals("0")) { params.put("type", type); } + + if (UserUtil.getUid(context) != null) { + params.put("uid", UserUtil.getUid(context) + ""); + } + commonPostWithFailture(context, BASE_URL2 + "commoncontent/getNavGoodsList", params, handler); } @@ -683,8 +724,8 @@ LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); params.put("orderId", orderId); params.put("userInfo.id", uid + ""); - params.put("type", type); - commonPostWithFailture(context, BASE_URL + "lostOrder/findLostOrder", params, handler); + params.put("type", type + ""); + commonPostWithFailture(context, BASE_URL2 + "lostOrder/findLostOrder", params, handler); } /** @@ -700,7 +741,7 @@ LinkedHashMap<String, String> params = new LinkedHashMap<>(); params.put("text", text); if (uid != null) params.put("uid", uid + ""); - commonPost(context, BASE_URL2 + "search/getRecommendInfo", params, handler); + commonPost(context, BASE_URL2 + "search/getRecommendInfoTJ", params, handler); } @@ -828,7 +869,7 @@ params.put("page", page); if (type != null) params.put("type", type); - commonPost(context, BASE_URL + "user/msg/getMsgList", params, handler); + commonPost(context, BASE_URL2 + "user/msg/getMsgList", params, handler); } /** @@ -991,7 +1032,7 @@ if (notifyType != null) params.put("notifyType", notifyType); if (uid != null) params.put("uid", uid + ""); - commonPost(context, BASE_URL2 + "search/searchGoods", params, handler); + commonPost(context, BASE_URL2 + "search/searchGoodsTJ", params, handler); } /** @@ -1267,42 +1308,19 @@ commonPost1(context, BASE_URL + "customer/saveInfo", params, paramsFiles, handler); } - /** - * 缁戝畾OPPO鎺ㄩ�� - * - * @param context - */ - public static void bindOPPOPush(Context context, Long uid, String registerId, BasicTextHttpResponseHandler handler) { - LinkedHashMap<String, String> params = new LinkedHashMap<>(); - params.put("registerId", registerId); - if (uid != null) params.put("uid", uid + ""); - commonPostWithFailture(context, BASE_URL + "push/registerOppo", params, handler); - } - - /** - * 缁戝畾VIVO鎺ㄩ�� - * - * @param context - */ - public static void bindVIVOPush(Context context, Long uid, String registerId, BasicTextHttpResponseHandler handler) { - LinkedHashMap<String, String> params = new LinkedHashMap<>(); - params.put("regId", registerId); - if (uid != null) params.put("uid", uid + ""); - commonPostWithFailture(context, BASE_URL + "push/registerVivo", params, handler); - } - /** * 缁戝畾XM鎺ㄩ�� * * @param context */ - public static void bindXMPush(Context context, Long uid, String regId, BasicTextHttpResponseHandler handler) { + public static void bindPushToken(Context context, Long uid, PushRomType pushRomType, String token, BasicTextHttpResponseHandler handler) { LinkedHashMap<String, String> params = new LinkedHashMap<>(); - params.put("regId", regId); + params.put("type", pushRomType.name()); + params.put("token", token); if (uid != null) params.put("uid", uid + ""); - commonPostWithFailture(context, BASE_URL + "push/registerXM", params, handler); + commonPostWithFailture(context, BASE_URL + "push/bindToken", params, handler); } @@ -1340,6 +1358,12 @@ params.put("slideVerify", slideVerify); params.put("phone", phone); commonPostWithFailture(context, BASE_URL + "sms/sendMSMLogin", params, handler); + } + + + public static void allowOneKeyLogin(Context context, BasicTextHttpResponseHandler handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + commonPostWithFailture(context, BASE_URL + "sms/allowOneKeyLogin", params, handler); } /** @@ -1559,18 +1583,6 @@ commonPostWithFailture(context, BASE_URL + "customer/getextractprocess", params, handler); } - /** - * 缁戝畾鍗庝负鎺ㄩ�� - * - * @param context - */ - public static void bindHMPush(Context context, String token, Long uid, - BasicTextHttpResponseHandler handler) { - LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); - params.put("token", token); - if (uid != null) params.put("uid", uid + ""); - commonPostWithFailture(context, BASE_URL + "push/bindHWPush", params, handler); - } /** * 鑾峰彇缃戦〉閰嶇疆淇℃伅 @@ -2423,6 +2435,10 @@ LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); params.put("page", page + ""); params.put("cid", cid); + if (UserUtil.getUid(context) != null) { + params.put("uid", UserUtil.getUid(context) + ""); + } + commonPostWithFailture(context, BASE_URL2 + "dynamic/getList", params, handler); } @@ -2971,6 +2987,10 @@ params.put("page", page); if (uid != null) params.put("uid", uid + ""); params.put("goodsType", goodsType); + if (UserUtil.getUid(context) != null) { + params.put("uid", UserUtil.getUid(context) + ""); + } + commonPostWithFailture(context, BASE_URL2 + "shraeStorage/getlist", params, handler); } @@ -3435,6 +3455,36 @@ commonPostWithFailture(context, BASE_URL2 + "goods/listSimpleGoods", params, handler); } + + public static void getSendingHongBao(Context context, + BasicTextHttpResponseHandler handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + Long uid = UserUtil.getUid(context); + if (uid != null) + params.put("uid", uid + ""); + commonPostWithFailture(context, BASE_URL2 + "lijin/hongbao/getSendingHongBao", params, handler); + } + + public static void getHongBaoBalance(Context context, + BasicTextHttpResponseHandler handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + Long uid = UserUtil.getUid(context); + if (uid != null) + params.put("uid", uid + ""); + commonPostWithFailture(context, BASE_URL2 + "lijin/hongbao/getHongBaoBalance", params, handler); + } + + public static void recieveHongBao(Context context, String id, + BasicTextHttpResponseHandler handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + Long uid = UserUtil.getUid(context); + if (uid != null) + params.put("uid", uid + ""); + params.put("id", id); + commonPostWithFailture(context, BASE_URL2 + "lijin/hongbao/recieveHongBao", params, handler); + } + + /** * 鍥㈤槦璧勯噾缁熻 * -- Gitblit v1.8.0