From 2f1ab8af88cae4e723126ea5cf2f7d42dff7dbdc Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 30 九月 2021 13:43:56 +0800 Subject: [PATCH] 穿山甲广告SDK更新,隐私合规修改 --- BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 206 insertions(+), 8 deletions(-) diff --git a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java index 8a0cf5f..6d65a30 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/BeibeiVideoAPI.java @@ -66,7 +66,6 @@ private static AsyncHttpClient sortTimeAsyncHttpClient = new AsyncHttpClient(); static { - mOkHttpClient = new OkHttpClient().newBuilder() .connectTimeout(10 * 1000, TimeUnit.SECONDS)//璁剧疆瓒呮椂鏃堕棿 .readTimeout(10 * 1000, TimeUnit.SECONDS)//璁剧疆璇诲彇瓒呮椂鏃堕棿 @@ -622,8 +621,14 @@ public static void getHotSearch(Context context, String uid, ResponseHandlerInterface handler) { LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); - params.put("Method", "getHotSearch"); + params.put("Method", "getHotSearchNew"); params.put("Uid", uid); + commonPost(context, BASE_URL + "user", params, handler); + } + + public static void getSearchRank(Context context, ResponseHandlerInterface handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + params.put("Method", "getSearchRank"); commonPost(context, BASE_URL + "user", params, handler); } @@ -757,12 +762,15 @@ } - public static void getHomeAd(Context context, String uid, String vtid, + public static void getHomeAd(Context context, String uid, String vtid, String dataKey, ResponseHandlerInterface handler) { LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); params.put("Method", "getHomeAd"); params.put("Uid", uid); params.put("Vtid", vtid); + if (dataKey != null) { + params.put("DataKey", dataKey); + } commonPost(context, BASE_URL + "recommend", params, handler); } @@ -831,12 +839,27 @@ } - public static void getHomeType(Context context, String uid, String vtid, + public static void getHomeType(Context context, String uid, String vtid, String dataKey, int page, int pageSize, ResponseHandlerInterface handler) { LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); - params.put("Method", "getHomeType"); + params.put("Method", "getHomeTypeNew"); params.put("Uid", uid); params.put("Vtid", vtid); + params.put("Page", page + ""); + params.put("PageSize", pageSize + ""); + if (dataKey != null) { + params.put("DataKey", dataKey); + } + commonPost(context, BASE_URL + "recommend", params, handler); + } + + + public static void getHomeVideoList(Context context, String id, int page, + ResponseHandlerInterface handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + params.put("Method", "getHomeVideoList"); + params.put("Id", id); + params.put("Page", page + ""); commonPost(context, BASE_URL + "recommend", params, handler); } @@ -1109,7 +1132,7 @@ } public static void getVideoDetail(Context context, String uid, - String ResourceId, String videoId, Integer position, String loginid, String type, + String ResourceId, String videoId, Integer position, String loginid, String type, String from, ResponseHandlerInterface handler) { LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); params.put("Method", "getVideoDetail"); @@ -1119,10 +1142,26 @@ if (position != null) { params.put("Position", position + ""); } + + if (from != null) { + params.put("From", from + ""); + } params.put("ResourceId", ResourceId); params.put("Type", type); commonPost(context, BASE_URL + "recommend", params, handler); + } + + + public static void uploadSession(Context context, String sessionId, + String type, + ResponseHandlerInterface handler) { + LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); + if (sessionId != null) + params.put("sessionId", sessionId); + if (type != null) + params.put("type", type); + commonPost(context, BASE_URL + "session/uploadSession", params, handler); } @@ -1137,12 +1176,13 @@ * @param handler */ public static void getVideoEpisodeList(Context context, String uid, - String ResourceId, String videoId, int page, + String ResourceId, String videoId, int page, int pageSize, ResponseHandlerInterface handler) { LinkedHashMap<String, String> params = new LinkedHashMap<String, String>(); params.put("Method", "getVideoEpisodeList"); params.put("Uid", uid); params.put("Page", page + ""); + params.put("PageSize", pageSize + ""); params.put("VideoId", videoId); params.put("ResourceId", ResourceId); commonPost(context, BASE_URL + "recommend", params, handler); @@ -1312,6 +1352,164 @@ commonPost(context, BASE_URL + "video/play/pptvPlay", params, handler); } + public static void pptvFinishPlay(Context context, String cid, String vid, Integer currentTime, + ResponseHandlerInterface handler) { + String loginUid = UserUtil.getLoginUid(context); + String uid = UserUtil.getUid(context); + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (loginUid != null) + params.put("loginUid", loginUid); + if (uid != null) + params.put("Uid", uid); + params.put("cid", cid); + params.put("vid", vid); + if (currentTime != null) { + params.put("currentTime", currentTime + ""); + } + + commonPost(context, BASE_URL + "video/play/pptvFinishPlay", params, handler); + } + + + /** + * 鑾峰彇PPTV鐨勬挱鏀剧姸鎬� + * + * @param context + * @param cid + * @param vid + * @param handler + */ + + public static void getPPTVVideoPlayState(Context context, String cid, String vid, + ResponseHandlerInterface handler) { + String loginUid = UserUtil.getLoginUid(context); + String uid = UserUtil.getUid(context); + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (loginUid != null) + params.put("loginUid", loginUid); + if (uid != null) + params.put("Uid", uid); + params.put("cid", cid); + params.put("vid", vid); + commonPost(context, BASE_URL + "video/play/getPPTVVideoPlayState", params, handler); + } + + + /** + * 浠樿垂瑙嗛鐨勮喘涔版椿鍔� + * + * @param context + * @param cid + * @param vid + * @param handler + */ + public static void getPPTVVIPVideoActivity(Context context, String url, String cid, String vid, + ResponseHandlerInterface handler) { + String loginUid = UserUtil.getLoginUid(context); + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (loginUid != null) + params.put("loginUid", loginUid); + if (url != null) { + params.put("url", url); + } + params.put("cid", cid); + params.put("vid", vid); + commonPost(context, BASE_URL + "video/play/getPPTVVIPVideoActivity", params, handler); + } + + /** + * --------------褰辫璞�-------------- + */ + + + /** + * 鎸e奖瑙嗚眴 + * + * @param context + * @param code + * @param param1 + * @param param2 + * @param handler + */ + public static void makeGoldCorn(Context context, String code, String param1, String param2, + ResponseHandlerInterface handler) { + String loginUid = UserUtil.getLoginUid(context); + if (loginUid == null || StringUtils.isEmpty(loginUid)) { + return; + } + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + params.put("loginUid", loginUid); + if (code != null) { + params.put("code", code); + } + if (code != null) { + params.put("param1", param1); + } + if (code != null) { + params.put("param2", param2); + } + commonPost(context, BASE_URL + "goldcorn/makeGoldCorn", params, handler); + } + + + //鑾峰彇绛惧埌淇℃伅 + public static void getSignInInfo(Context context, + ResponseHandlerInterface handler) { + String loginUid = UserUtil.getLoginUid(context); + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (loginUid != null) + params.put("loginUid", loginUid); + + commonPost(context, BASE_URL + "goldcorn/getSignInData", params, handler); + } + + //绛惧埌 + public static void signIn(Context context, + ResponseHandlerInterface handler) { + String loginUid = UserUtil.getLoginUid(context); + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (loginUid != null) + params.put("loginUid", loginUid); + + commonPost(context, BASE_URL + "goldcorn/signIn", params, handler); + } + + //鏄惁鍙互鍋氶噾甯佷换鍔� + public static void canDoGoldCornTask(Context context, String code, + ResponseHandlerInterface handler) { + String loginUid = UserUtil.getLoginUid(context); + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (loginUid != null) + params.put("loginUid", loginUid); + + params.put("code", code); + + commonPost(context, BASE_URL + "goldcorn/canDoTask", params, handler); + } + + + //鑾峰彇鍙互鍏戞崲鍒哥殑瑙嗛 + public static void getGoldCornCouponVideoList(Context context, + ResponseHandlerInterface handler) { + String loginUid = UserUtil.getLoginUid(context); + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (loginUid != null) + params.put("loginUid", loginUid); + + commonPost(context, BASE_URL + "goldcorn/getCouponVideoList", params, handler); + } + + //鑾峰彇浠诲姟鍒楄〃 + public static void getGoldCornTaskList(Context context, + ResponseHandlerInterface handler) { + String loginUid = UserUtil.getLoginUid(context); + LinkedHashMap<String, String> params = new LinkedHashMap<>(); + if (loginUid != null) + params.put("loginUid", loginUid); + + commonPost(context, BASE_URL + "goldcorn/getTaskList", params, handler); + } + public static LinkedHashMap<String, String> validateParams( LinkedHashMap<String, String> params, Context context) { @@ -1365,7 +1563,7 @@ for (Iterator<String> its = params.keySet().iterator(); its.hasNext(); ) { String key = its.next(); if (params.get(key) != null) { - newParams.put(key,params.get(key)); + newParams.put(key, params.get(key)); } } -- Gitblit v1.8.0