From 42fa17d6209d10cbe4774388d0ff3fcf3329eb5a Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 16 六月 2021 13:53:17 +0800
Subject: [PATCH] zookeeper地址修改

---
 src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java |  117 +++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 91 insertions(+), 26 deletions(-)

diff --git a/src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java b/src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java
index 3754f39..e6007b0 100644
--- a/src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java
+++ b/src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java
@@ -5,6 +5,7 @@
 import com.yeshi.buwan.domain.ad.CommonAdPositionAd;
 import com.yeshi.buwan.domain.recommend.CategoryRecommendVideo;
 import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial;
+import com.yeshi.buwan.domain.solr.SolrAlbumVideo;
 import com.yeshi.buwan.domain.special.Special;
 import com.yeshi.buwan.domain.system.DetailSystem;
 import com.yeshi.buwan.dto.search.SolrResultDTO;
@@ -19,6 +20,7 @@
 import com.yeshi.buwan.util.JuHe.VideoResourceUtil;
 import com.yeshi.buwan.util.ad.CommonAdUtil;
 import com.yeshi.buwan.util.annotation.RequireUid;
+import com.yeshi.buwan.util.factory.VideoInfoFactory;
 import com.yeshi.buwan.util.video.VideoConstant;
 import com.yeshi.buwan.vo.AcceptData;
 import com.yeshi.buwan.vo.HomeClassVO;
@@ -121,8 +123,14 @@
             if (!StringUtil.isNullOrEmpty(list.get(i).getPicture())) {
                 list.get(i).getType().setIcon(list.get(i).getPicture());
             }
-            typeList.add(list.get(i).getType());
+            if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() >= Constant.IOS_ONLINING_VERSION) {
+                if (VideoConstant.isMainCategory(list.get(i).getType().getId())) {
+                    typeList.add(list.get(i).getType());
+                }
+            } else
+                typeList.add(list.get(i).getType());
         }
+
 
         JSONObject object = new JSONObject();
         object.put("count", (new StringBuilder(String.valueOf(typeList.size()))).toString());
@@ -157,28 +165,6 @@
             }
         }
 
-
-        if ("android".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() > 53 && !"qq".equalsIgnoreCase(acceptData.getChannel())) {
-            SuperVideoType sty = new SuperVideoType();
-            sty.setCreatetime(0 + "");
-            sty.setPicture("");
-            VideoType vt = new VideoType(Constant.VIDEO_TYPE_ZHIBO);
-            vt.setName("缇庡コ鐩存挱");
-            vt.setShow("1");
-            vt.setCategoryType("http://m.v.6.cn/event/porkvideo?src=9n8wc5medm&nologo=1&t=2");
-            vt.setIcon("https://hbimg.huabanimg.com/12834704bb4aa39342c2fb51e0c644181b13997b70eb-CqlE1I_fw658/format/webp");
-            sty.setType(vt);
-            boolean isC = false;
-            for (SuperVideoType svt : list) {
-                if (svt.getType().getId() == vt.getId()) {
-                    isC = true;
-                    break;
-                }
-            }
-
-            if (!isC)
-                list.add(sty);
-        }
 
         //Android骞冲彴3.8.7涔嬪悗杩斿洖VIP
         if ("android".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() >= 105) {
@@ -259,6 +245,44 @@
             typelist.add(type);
         }
 
+        if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() >= Constant.IOS_ONLINING_VERSION) {
+            typelist = new ArrayList<>();
+            HomeClassVO vo = new HomeClassVO();
+            vo.setId(309L);
+            vo.setName("鎺ㄨ崘");
+            vo.setShowTitle("鎺ㄨ崘");
+            vo.setDataType(HomeClassVO.DATA_TYPE_RECOMMEND);
+            typelist.add(vo);
+
+            vo = new HomeClassVO();
+            vo.setId(VideoConstant.VIDEO_CATEGORY_DIANYING);
+            vo.setName("鐢靛奖");
+            vo.setShowTitle("鐢靛奖");
+            vo.setDataType(HomeClassVO.DATA_TYPE_CLASS);
+            typelist.add(vo);
+
+            vo = new HomeClassVO();
+            vo.setId(VideoConstant.VIDEO_CATEGORY_DIANSHIJU);
+            vo.setName("鐢佃鍓�");
+            vo.setShowTitle("鐢佃鍓�");
+            vo.setDataType(HomeClassVO.DATA_TYPE_CLASS);
+            typelist.add(vo);
+
+            vo = new HomeClassVO();
+            vo.setId(VideoConstant.VIDEO_CATEGORY_DONGMAN);
+            vo.setName("鍔ㄦ极");
+            vo.setShowTitle("鍔ㄦ极");
+            vo.setDataType(HomeClassVO.DATA_TYPE_CLASS);
+            typelist.add(vo);
+
+            vo = new HomeClassVO();
+            vo.setId(VideoConstant.VIDEO_CATEGORY_ZONGYI);
+            vo.setName("缁艰壓");
+            vo.setShowTitle("缁艰壓");
+            vo.setDataType(HomeClassVO.DATA_TYPE_CLASS);
+            typelist.add(vo);
+        }
+
         JSONObject object = new JSONObject();
         object.put("count", (new StringBuilder(String.valueOf(typelist.size()))).toString());
         JSONArray array = new JSONArray();
@@ -315,7 +339,10 @@
                 vo.setShowTitle(special.getName());
                 vo.setDataKey(special.getDataKey());
                 vo.setDataType(HomeClassVO.DATA_TYPE_RECOMMEND);
+                if (vo.getName().contains("楂樻竻"))
+                    vo.setColor("#ff6600");
                 typelist.add(0, vo);
+
             }
         }
 
@@ -479,7 +506,7 @@
 
             } else if (!StringUtil.isNullOrEmpty(homeType)) {
 
-                list = new ArrayList<VideoInfo>();
+                list = new ArrayList<>();
                 List<HomeVideo> homeVideoList = homeTypeService.getVideoByTypes(homeType, pageIndex, detailSystem);
 
                 for (HomeVideo hv : homeVideoList) {
@@ -818,11 +845,33 @@
         out.print(JsonUtil.loadTrueJson(object.toString()));
     }
 
+    @Resource
+    private VideoResourceService videoResourceService;
+
     @RequireUid
     public void getSpecialDetail(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
         String specialid = request.getParameter("Id");
         Special special = specialService.getSpecial(specialid);
         List<VideoInfo> list = specialService.getSpecialVideoList(specialid);
+        List<Long> availableResourceIds = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion());
+        List<VideoInfo> tempList = new ArrayList<>();
+        for (VideoInfo videoInfo : list) {
+            List<VideoResource> resourceList = videoResourceService.getResourceByVideo(videoInfo);
+            List<Long> rids = new ArrayList<>();
+            for (VideoResource vr : resourceList) {
+                if (availableResourceIds.contains(Long.parseLong(vr.getId()))) {
+                    rids.add(Long.parseLong(vr.getId()));
+                    break;
+                }
+            }
+            if (rids.size() > 0) {
+                tempList.add(videoInfo);
+            }
+        }
+
+        list = tempList;
+
+
         JSONObject object = new JSONObject();
         object.put("count", list.size());
         JSONArray array = new JSONArray();
@@ -895,8 +944,24 @@
     public void getRecommendCategoryVideoList(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
         String typeid = request.getParameter("Type");
         DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
-        List<VideoInfo> rankList = categoryRecommendCacheVideoService.getVideoListByRank(Integer.parseInt(typeid),
-                detailSystem.getId(), acceptData.getPlatform(), acceptData.getVersion());
+        List<VideoInfo> rankList = null;
+        if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() >= Constant.IOS_ONLINING_VERSION) {
+            SolrVideoSearchFilter filter = new SolrVideoSearchFilter();
+            filter.setResourceIds(new String[]{25 + ""});
+            filter.setVideoType(Integer.parseInt(typeid));
+            filter.setFreeType(0);
+            SolrResultDTO dto = solrAlbumVideoDataManager.find(filter, 1, 30);
+            List<SolrAlbumVideo> list = dto.getVideoList();
+            rankList = new ArrayList<>();
+            for (SolrAlbumVideo video : list) {
+                rankList.add(VideoInfoFactory.create(video));
+            }
+        } else {
+            rankList = categoryRecommendCacheVideoService.getVideoListByRank(Integer.parseInt(typeid),
+                    detailSystem.getId(), acceptData.getPlatform(), acceptData.getVersion());
+        }
+
+
         List<VideoInfo> list = new ArrayList<>();
         list.addAll(rankList);
         for (VideoInfo vi : list) {// 娓呴櫎鏃犵敤鏁版嵁,闃叉娴垂甯﹀,鏇存敼鍥剧墖

--
Gitblit v1.8.0