From cdc3690a0354e01b44852f4c9da3b7204128d2eb Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 13 八月 2021 18:46:36 +0800 Subject: [PATCH] 增加苹果内购回调日志,兼容苹果内购 --- src/main/java/com/yeshi/buwan/util/video/VideoDetailUtil.java | 72 ++++++++++++++++++++++++++++++++++-- 1 files changed, 68 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/util/video/VideoDetailUtil.java b/src/main/java/com/yeshi/buwan/util/video/VideoDetailUtil.java index 241f304..18a91f7 100644 --- a/src/main/java/com/yeshi/buwan/util/video/VideoDetailUtil.java +++ b/src/main/java/com/yeshi/buwan/util/video/VideoDetailUtil.java @@ -11,16 +11,22 @@ import com.yeshi.buwan.funtv.FunTVUtil2; import com.yeshi.buwan.iqiyi.util.IqiyiUtil; import com.yeshi.buwan.iqiyi.util.IqiyiUtil2; +import com.yeshi.buwan.mogotv.MogoTVUtil; import com.yeshi.buwan.service.imp.VideoInfoService; +import com.yeshi.buwan.service.imp.VideoResourceService; import com.yeshi.buwan.service.imp.juhe.FunTVService; import com.yeshi.buwan.service.imp.juhe.IqiyiService; import com.yeshi.buwan.service.imp.juhe.SoHuService; -import com.yeshi.buwan.service.inter.juhe.FunTV2Service; -import com.yeshi.buwan.service.inter.juhe.Iqiyi2Service; +import com.yeshi.buwan.service.inter.juhe.*; +import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; import com.yeshi.buwan.sohu.SoHuUtil; +import com.yeshi.buwan.tencent.TencentVideoUtil; import com.yeshi.buwan.util.StringUtil; import com.yeshi.buwan.util.log.VideoLogFactory; +import com.yeshi.buwan.util.video.shortvideo.ShortVideoUtil; +import com.yeshi.buwan.videos.bilibili.BilibiliUtil; import com.yeshi.buwan.vo.AcceptData; +import com.yeshi.buwan.youku.YouKuUtil; import org.hibernate.HibernateException; import org.hibernate.Session; import org.slf4j.Logger; @@ -64,11 +70,35 @@ @Resource private VideoInfoService videoInfoService; + @Resource + private YouKuUtil youKuUtil; + + @Resource + private YouKuService youKuService; + + @Resource + private MogoTVUtil mogoTVUtil; + + @Resource + private MogoTVService mogoTVService; + + @Resource + private TencentVideoService tencentVideoService; + + @Resource + private TencentVideoUtil tencentVideoUtil; + + @Resource + private BilibiliVideoService bilibiliVideoService; + + @Resource + private BilibiliUtil bilibiliUtil; + @SuppressWarnings("unchecked") // @Cacheable(value = "homeCache", key = "'getVideoInfo'+'-'+#videoid+'-'+#resourceId+'-'+#cacheMD5") - public VideoInfo getVideoInfo(String detailSystemId,final String videoid, final String resourceId, final List<Long> reList, + public VideoInfo getVideoInfo(String detailSystemId, final String videoid, final String resourceId, final List<Long> reList, String cacheMD5) { - playLogger.info(VideoLogFactory.createVideoDetailLog(detailSystemId, videoid,resourceId)); + playLogger.info(VideoLogFactory.createVideoDetailLog(detailSystemId, videoid, resourceId)); return (VideoInfo) videoInfoDao.excute(new HibernateCallback<VideoInfo>() { public VideoInfo doInHibernate(Session session) throws HibernateException { @@ -198,6 +228,14 @@ return videoInfoService.getVideoDetailList(videoid, vr, page, pageSize); case SoHuUtil.RESOURCE_ID: return soHuService.getVideoDetailList(videoid, page, pageSize); + case YouKuUtil.RESOURCE_ID: + return youKuService.getVideoDetailList(videoid, page, pageSize); + case MogoTVUtil.RESOURCE_ID: + return mogoTVService.getVideoDetailList(videoid, page, pageSize); + case TencentVideoUtil.RESOURCE_ID: + return tencentVideoService.getVideoDetailList(videoid, page, pageSize); + case BilibiliUtil.RESOURCE_ID: + return bilibiliVideoService.getVideoDetailList(videoid, page, pageSize); default: return null; } @@ -217,6 +255,10 @@ return funTVService.getLatestVideoDetail(videoid); case SoHuUtil.RESOURCE_ID: return soHuService.getLatestVideoDetail(videoid); + case YouKuUtil.RESOURCE_ID: + return soHuService.getLatestVideoDetail(videoid); + case MogoTVUtil.RESOURCE_ID: + return soHuService.getLatestVideoDetail(videoid); default: return null; } @@ -235,14 +277,28 @@ return funTVService.getShowType(videoid); case SoHuUtil.RESOURCE_ID: return soHuUtil.getShowType(videoid); + case YouKuUtil.RESOURCE_ID: + return soHuUtil.getShowType(videoid); default: return 1; } } + @Resource + private SolrShortVideoDataManager solrShortVideoDataManager; + + @Resource + private VideoResourceService videoResourceService; + + @Cacheable(value = "homeCache", key = "'getPlayUrl'+'-'+#detailSystemId+'-'+#id+'-'+#type+'-'+#resourceid") public PlayUrl getPlayUrl(AcceptData acceptData, String detailSystemId, String id, String type, int resourceid, String videoid) { playLogger.info(VideoLogFactory.createPlayUrlLog(detailSystemId, id, type, resourceid, videoid)); + if (ShortVideoUtil.isShortVideoId(id)) { + VideoResource vr = videoResourceService.getResource(resourceid + ""); + return solrShortVideoDataManager.getPlayUrl(id, vr); + } + switch (resourceid) { case IqiyiUtil2.RESOURCE_ID: return iqiyi2Service.getPlayUrl(detailSystemId, resourceid, id, videoid); @@ -256,6 +312,14 @@ return soHuUtil.getPlayUrl(detailSystemId, resourceid + "", type, id); case AcFunUtil.RESOURCE_ID: return videoInfoService.getPlayUrl(detailSystemId, id, type, resourceid, videoid); + case YouKuUtil.RESOURCE_ID: + return youKuUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); + case MogoTVUtil.RESOURCE_ID: + return mogoTVUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); + case TencentVideoUtil.RESOURCE_ID: + return tencentVideoUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); + case BilibiliUtil.RESOURCE_ID: + return bilibiliUtil.getPlayUrl(detailSystemId, id, type, resourceid, videoid); default: return null; } -- Gitblit v1.8.0