admin
2021-06-08 cca287441f277a3049cc280ae0d1e622d99d22ef
app/src/main/java/com/tejia/lijin/app/ShoppingApi.java
@@ -65,6 +65,8 @@
    public static OkHttpClient mOkHttpClientSoon;//okHttpClient 实例
    private final static String API_PACKAGE_NAME = "com.youhuiquan.android";
    static {
        mOkHttpClient = new OkHttpClient.Builder()
                .connectTimeout(10 * 1000, TimeUnit.MILLISECONDS)
@@ -119,6 +121,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);
    }
@@ -257,6 +263,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);
    }
@@ -369,7 +379,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);
    }
@@ -389,7 +400,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)
@@ -410,11 +422,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);
    }
    /**
     * 首页顶部分类分类数据
@@ -545,6 +593,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);
    }
@@ -558,6 +609,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);
    }
@@ -666,6 +720,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);
    }
@@ -681,8 +740,7 @@
        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);
        commonPostWithFailture(context, BASE_URL2 + "lostOrder/findLostOrder", params, handler);
    }
    /**
@@ -826,7 +884,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);
    }
    /**
@@ -1129,6 +1187,15 @@
        commonPostWithFailture(context, BASE_URL + "user/bindWeiXin", params, handler);
    }
    public static void bindQQ(Context context, Long uid, String qqUser,
                              BasicTextHttpResponseHandler handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        if (uid != null) params.put("uid", uid + "");
        params.put("qqUser", qqUser);
        commonPostWithFailture(context, BASE_URL + "user/bindQQ", params, handler);
    }
    /**
     * app更新
     *
@@ -1331,6 +1398,12 @@
        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);
    }
    /**
     * 新登录获取短信验证码
     *
@@ -1458,12 +1531,23 @@
     * @param context vcode短信验证码 phone电话号码  code微信登录的code
     * @param handler loginType 1电话 2微信
     */
    public static void loginNew(Context context, String vcode, String phone, String code, String loginType, BasicTextHttpResponseHandler handler) {
    public static void loginNew(Context context, String vcode, String phone, String code, String loginType, String accessToken, String qqUser, BasicTextHttpResponseHandler handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        params.put("vcode", vcode);
        params.put("phone", phone);
        params.put("code", code);
        if (vcode != null)
            params.put("vcode", vcode);
        if (phone != null)
            params.put("phone", phone);
        if (code != null)
            params.put("code", code);
        params.put("loginType", loginType);
        if (accessToken != null) {
            params.put("aliAccessToken", accessToken);
        }
        if (qqUser != null) {
            params.put("qqUser", qqUser);
        }
        commonPostWithFailture(context, BASE_URL2 + "user/login", params, handler);
    }
@@ -1486,20 +1570,28 @@
     * @param context vcode短信验证码 phone电话号码  code微信登录的code
     * @param handler loginType 1电话 2微信
     */
    public static void bindPhoneNew(Context context, String vcode, String phone, Long uid, BasicTextHttpResponseHandler handler) {
    public static void bindPhoneNew(Context context, String vcode, String phone, String accessToken, Long uid, BasicTextHttpResponseHandler handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<>();
        params.put("vcode", vcode);
        params.put("phone", phone);
        if (vcode != null)
            params.put("vcode", vcode);
        if (phone != null)
            params.put("phone", phone);
        if (accessToken != null)
            params.put("aliAccessToken", accessToken);
        if (uid != null) params.put("uid", uid + "");
        commonPostWithFailture(context, BASE_URL + "user/bindPhoneNew", params, handler);
    }
    public static void bindPhoneWithOutLogin(Context context, String vcode, String phone, String key, BasicTextHttpResponseHandler handler) {
    public static void bindPhoneWithOutLogin(Context context, String vcode, String phone, String accessToken, String key, BasicTextHttpResponseHandler handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<>();
        params.put("vcode", vcode);
        params.put("phone", phone);
        if (vcode != null)
            params.put("vcode", vcode);
        if (phone != null)
            params.put("phone", phone);
        params.put("key", key);
        if (accessToken != null)
            params.put("aliAccessToken", accessToken);
        commonPostWithFailture(context, BASE_URL2 + "user/bindPhoneLogin", params, handler);
    }
@@ -1654,7 +1746,8 @@
        LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
        if (uid != null) params.put("uid", uid + "");
        params.put("auctionId", goodsId);
        params.put("from", from);
        if (from != null)
            params.put("from", from);
        if (!StringUtils.isEmpty(source))
            params.put("source", source);
        commonPostWithFailture(context, BASE_URL + "goods/gettaobaolink", params, handler);
@@ -1670,7 +1763,8 @@
        LinkedHashMap<String, String> params = new LinkedHashMap<>();
        if (uid != null) params.put("uid", uid + "");
        params.put("id", goodsId);
        params.put("from", from);
        if (from != null)
            params.put("from", from);
        if (!StringUtils.isEmpty(source))
            params.put("source", source);
        if (!StringUtils.isEmpty(couponLink))
@@ -2391,6 +2485,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);
    }
@@ -2939,6 +3037,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);
    }
@@ -3054,6 +3156,70 @@
            params.put("from", from);
        commonPostWithFailture(context, BuXinConstant.HOST + "/fanli/api/lijin/goods/getGoodsDetail", params, handler);
    }
    /**
     * 通过淘礼金购买
     *
     * @param context
     * @param goodsId
     * @param goodsType
     * @param lijinId
     * @param uid
     * @param from
     * @param handler
     */
    public static void buyWithLijin(Context context, String goodsId, int goodsType, String lijinId, Long uid, String from,
                                    BasicTextHttpResponseHandler handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<>();
        params.put("goodsId", goodsId);
        params.put("goodsType", goodsType + "");
        if (lijinId != null)
            params.put("lijinId", lijinId);
        if (uid != null) params.put("uid", uid + "");
        if (from != null)
            params.put("from", from);
        commonPostWithFailture(context, BuXinConstant.HOST + "/fanli/api/lijin/goods/buyWithLijin", params, handler);
    }
    /**
     * 获取用户礼金的创建信息
     *
     * @param context
     * @param goodsId
     * @param goodsType
     * @param lijinId
     * @param uid
     * @param from
     * @param handler
     */
    public static void getUserLijinCreatedInfo(Context context, String goodsId, Integer goodsType, Long uid,
                                               BasicTextHttpResponseHandler handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<>();
        if (goodsId != null)
            params.put("goodsId", goodsId);
        if (goodsType != null)
            params.put("goodsType", goodsType + "");
        if (uid != null) params.put("uid", uid + "");
        commonPostWithFailture(context, BuXinConstant.HOST + "/fanli/api/lijin/user/getUserLijinCreatedInfo", params, handler);
    }
    /**
     * 获取礼金的用户等级
     *
     * @param context
     * @param uid
     * @param handler
     */
    public static void getLijinUserLevel(Context context, Long uid,
                                         BasicTextHttpResponseHandler handler) {
        LinkedHashMap<String, String> params = new LinkedHashMap<>();
        if (uid != null) params.put("uid", uid + "");
        commonPostWithFailture(context, BuXinConstant.HOST + "/fanli/api/lijin/user/getUserLevel", params, handler);
    }
    /**
     * 淘宝获取商品信息1.3.9
@@ -3501,7 +3667,7 @@
        int version = PackageUtils2.getVersionCode(context);
        long time = System.currentTimeMillis();
        String deviceType = MobileUtil.getSystemModel();
        params.put("packages", "com.yeshi.ec.rebate");
        params.put("packages", API_PACKAGE_NAME);
        params.put("Version", version + "");
        params.put("appkey", BuXinConstant.TAO_BAO_KE_KEY);
        params.put("platform", "android");
@@ -3551,7 +3717,7 @@
        int version = PackageUtils2.getVersionCode(context);
        long time = System.currentTimeMillis();
        String deviceType = MobileUtil.getSystemModel();
        params.put("packages", "com.yeshi.ec.rebate");
        params.put("packages", API_PACKAGE_NAME);
        params.put("Version", version + "");
        params.put("appkey", BuXinConstant.TAO_BAO_KE_KEY);
        params.put("platform", "android");
@@ -3610,7 +3776,7 @@
        int version = PackageUtils2.getVersionCode(context);
        long time = System.currentTimeMillis();
        String deviceType = MobileUtil.getSystemModel();
        params.put("packages", "com.yeshi.ec.rebate");
        params.put("packages", API_PACKAGE_NAME);
        params.put("Version", version + "");
        params.put("appkey", BuXinConstant.TAO_BAO_KE_KEY);
        params.put("platform", "android");