From 36aafca8d6c1964bb755fe2ae030b163b6d0f92b Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期日, 25 四月 2021 19:22:24 +0800
Subject: [PATCH] 后台分区网页优化,HomeVideo初步支持来自全网搜的数据

---
 src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java b/src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java
index b804e7c..381676e 100644
--- a/src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java
+++ b/src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java
@@ -31,6 +31,7 @@
 import com.yeshi.buwan.service.inter.juhe.PPTVService;
 import com.yeshi.buwan.service.inter.juhe.YouKuService;
 import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService;
+import com.yeshi.buwan.service.inter.recommend.HomeVideoService;
 import com.yeshi.buwan.service.inter.video.VideoWatchHistoryService;
 import com.yeshi.buwan.service.manager.VideoPlayStatisticManager;
 import com.yeshi.buwan.tencent.TencentVideoUtil;
@@ -71,6 +72,10 @@
     private HomeAdService homeAdService;
     @Resource
     private HomeTypeService homeTypeService;
+
+    @Resource
+    private HomeVideoService homeVideoService;
+
     @Resource
     private DetailSystemConfigService configService;
     @Resource
@@ -310,11 +315,11 @@
 
                 long bigPictureCount = homeType.isBigPicture() ? 1 : 0;// homeTypeService.getHomeVideoListCount(homeType.getId(), resourceKey, resourceList, true);
 
-                List<HomeVideo> homeVideoList = homeTypeService.getHomeVideoList(homeType.getId(), resourceKey, resourceList, null, 1, homeType.getNumber() + (int) bigPictureCount);
+                List<HomeVideo> homeVideoList = homeVideoService.getHomeVideoList(homeType.getId(), resourceKey, resourceList, null, 1, homeType.getNumber() + (int) bigPictureCount);
                 if (bigPictureCount > 0 && homeVideoList.size() > 0) {
                     homeVideoList.get(0).setBigPicture(true);
                 }
-                long videoCount = homeTypeService.getHomeVideoListCount(homeType.getId(), resourceKey, resourceList, null);
+                long videoCount = homeVideoService.getHomeVideoListCount(homeType.getId(), resourceKey, resourceList, null);
 
                 if (videoCount - bigPictureCount > homeType.getNumber()) {
                     while ((videoCount - bigPictureCount) % homeType.getNumber() != 0) {
@@ -397,7 +402,7 @@
         List<HomeVideo> bigPictureVideos = new ArrayList<>();
 
         if (homeType.isBigPicture()) {
-            bigPictureVideos = homeTypeService.getHomeVideoList(homeTypeId, org.yeshi.utils.StringUtil.concat(resourceList, ","), resourceList, null, 1, 1);
+            bigPictureVideos = homeVideoService.getHomeVideoList(homeTypeId, org.yeshi.utils.StringUtil.concat(resourceList, ","), resourceList, null, 1, 1);
             if (bigPictureVideos != null && bigPictureVideos.size() > 0)
                 bigPictureVideos.get(0).setBigPicture(true);
         }
@@ -407,7 +412,7 @@
         JSONObject object = new JSONObject();
         String resourceKey = StringUtil.Md5(org.yeshi.utils.StringUtil.concat(resourceList, ","));
 
-        Long count = homeTypeService.getHomeVideoListCount(homeTypeId, resourceKey, resourceList, null);
+        Long count = homeVideoService.getHomeVideoListCount(homeTypeId, resourceKey, resourceList, null);
         if (count - bigPictureVideos.size() > homeType.getNumber()) {
 
             while ((count - bigPictureVideos.size()) % homeType.getNumber() != 0) {
@@ -416,7 +421,7 @@
         }
 
 
-        List<HomeVideo> list1 = homeTypeService.getHomeVideoList(homeTypeId, resourceKey, resourceList, homeType.isBigPicture(), page, homeType.getNumber());
+        List<HomeVideo> list1 = homeVideoService.getHomeVideoList(homeTypeId, resourceKey, resourceList, homeType.isBigPicture(), page, homeType.getNumber());
         List<HomeVideo> list = new ArrayList<>();
         list.addAll(bigPictureVideos);
         list.addAll(list1);
@@ -463,7 +468,7 @@
 
         List<HomeVideo> homeVideoList = homeTypeService.getVideoByTypes(type, pageIndex, detailSystem);
 
-        List<VideoInfo> list = new ArrayList<VideoInfo>();
+        List<VideoInfo> list = new ArrayList<>();
         for (int i = 0; i < homeVideoList.size(); i++) {
             HomeVideo hv = (HomeVideo) homeVideoList.get(i);
             if (acceptData.getPackageName().contains("doudou")) {

--
Gitblit v1.8.0