From ab35ac8b769b2d9816dffb33a64f2c6f7bd5dd6e Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 05 九月 2024 17:05:55 +0800 Subject: [PATCH] 风行网页版爬虫 --- src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java b/src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java index 675175f..8b240dd 100644 --- a/src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java +++ b/src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java @@ -1,8 +1,12 @@ package com.yeshi.buwan.util.JuHe; import com.yeshi.buwan.domain.system.DetailSystem; +import com.yeshi.buwan.service.imp.DetailSystemConfigService; import com.yeshi.buwan.service.inter.video.VideoResourcePlayVersionMapService; import com.yeshi.buwan.service.inter.video.VideoResourceVersionMapService; +import com.yeshi.buwan.util.config.SystemConfigUtil; +import com.yeshi.buwan.videos.funtv.FunTVUtil; +import net.sf.json.JSONObject; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; @@ -18,6 +22,9 @@ @Resource private VideoResourcePlayVersionMapService videoResourcePlayVersionMapService; + @Resource + private DetailSystemConfigService detailSystemConfigService; + @Cacheable(value = "homeCache", key = "'getAvailableResourceIds-'+'-'+#detailSystem.id+'-'+#versionCode+'-'+#channel") public List<Long> getAvailableResourceIds(DetailSystem detailSystem, int versionCode,String channel) { List<String> ridList = videoResourceVersionMapService.listResourceId(detailSystem.getId(), versionCode,channel.toLowerCase()); @@ -29,6 +36,23 @@ // } ridList.remove(25+""); ridList.remove(28+""); + //TODO 娌℃湁涓婄嚎闇�瑕佹竻闄� + ridList.add(FunTVUtil.RESOURCE_ID+""); + //鏄惁鏄娆′笂绾� + String firstOnLineValue = detailSystemConfigService.getConfigValueByKey("first_online_versions",detailSystem.getId(), versionCode); + if( SystemConfigUtil.isFirstOnLine(firstOnLineValue, channel, versionCode)){ + // 棣栨涓婄嚎瑕佹墦寮�椋庤 + ridList.add(FunTVUtil.RESOURCE_ID+""); + } + //闊╁墽涓婄嚎鐨勬椂鍊欓渶瑕佹墦寮� +// if(detailSystem.getId().equalsIgnoreCase("51")){ +// ridList.add("28"); +// } + +// ridList.clear(); +// ridList.add("13"); +// ridList.add("22"); + List<Long> ids = new ArrayList<>(); if (ridList != null) { for (String id : ridList) { @@ -43,6 +67,18 @@ @Cacheable(value = "homeCache", key = "'getAvailablePlayResourceIds-'+'-'+#detailSystem.id+'-'+#versionCode+'-'+#channel") public List<Long> getAvailablePlayResourceIds(DetailSystem detailSystem, int versionCode,String channel) { List<String> ridList = videoResourcePlayVersionMapService.listResourceId(detailSystem.getId(), versionCode,channel.toLowerCase()); + // 闊╁墽涓婄嚎闇�瑕佹墦寮�娉ㄩ噴 +// if(detailSystem.getId().equalsIgnoreCase("51")){ +// ridList.add("28"); +// } + // 棣栨涓婄嚎瑕佹墦寮�椋庤 + //TODO 娌℃湁涓婄嚎闇�瑕佹竻闄� + ridList.add(FunTVUtil.RESOURCE_ID+""); + String firstOnLineValue = detailSystemConfigService.getConfigValueByKey("first_online_versions",detailSystem.getId(), versionCode); + if( SystemConfigUtil.isFirstOnLine(firstOnLineValue, channel, versionCode)){ + ridList.add(FunTVUtil.RESOURCE_ID+""); + } + List<Long> ids = new ArrayList<>(); if (ridList != null) { for (String id : ridList) { -- Gitblit v1.8.0