From b30fb8afd3cd6228bda9b182dc412bb3c8daf69c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 17 十月 2024 16:28:48 +0800 Subject: [PATCH] CMQ转为Rabbitmq --- src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java b/src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java index 4e94ffe..47afac2 100644 --- a/src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java +++ b/src/main/java/com/yeshi/buwan/controller/parser/web/WebHomeParser.java @@ -8,6 +8,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import com.yeshi.buwan.exception.video.VideoPlayException; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.methods.GetMethod; @@ -123,6 +124,7 @@ String sign = request.getParameter("Sign"); String platform = request.getParameter("Platform"); String packageName = request.getParameter("Package"); + String channel = request.getParameter("Channel"); if (StringUtil.isNullOrEmpty(method)) { out.print(JsonUtil.loadFalseJson("璇蜂笂浼燤ethod")); return; @@ -164,7 +166,7 @@ array.add(StringUtil.outPutResultJson(list.get(i))); object.put("homeAdList", array); - object.put("homeTypeList", getHomeType(uid, platform, detailSystem.getId())); + object.put("homeTypeList", getHomeType(uid, platform, detailSystem.getId(), channel)); // 鎺掕 JSONObject rank = new JSONObject(); @@ -188,9 +190,9 @@ } // 棣栭〉绫诲瀷鑾峰彇 - private JSONArray getHomeType(String uid, String platform, String detailsystemid) { + private JSONArray getHomeType(String uid, String platform, String detailsystemid, String channel) { - List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1); + List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1, channel); List<HomeType> list1 = homeTypeService.getHomeType(detailsystemid, platform, 1, resourceList, CacheUtil.getMD5Long(resourceList), 10, "recommend"); List<HomeType> list = new ArrayList<>(); @@ -389,7 +391,7 @@ return; } - List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1); + List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), 1, null); DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName); List<VideoType> typeList = getFirstType(pid); @@ -770,7 +772,7 @@ return; } - List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), Integer.parseInt(version)); + List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(new DetailSystem("44"), Integer.parseInt(version), null); VideoInfo info = (videoDeailUtil.getVideoInfo(null, videoId, resourceId, resourceList, CacheUtil.getMD5Long(resourceList))); @@ -933,7 +935,12 @@ DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName); - PlayUrl pu = videoDeailUtil.getPlayUrl(null, detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId); + PlayUrl pu = null; + try { + pu = videoDeailUtil.getPlayUrl(null, detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId); + } catch (VideoPlayException e) { + e.printStackTrace(); + } if (pu != null) { if (!StringUtil.isNullOrEmpty(pu.getUrl())) -- Gitblit v1.8.0