| | |
| | | package com.yeshi.buwan.service.imp.ad; |
| | | |
| | | import com.yeshi.buwan.dao.ad.DeviceAdStrategyDao; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.ad.DeviceAdStrategy; |
| | | import com.yeshi.buwan.service.imp.VideoInfoService; |
| | | import com.yeshi.buwan.service.inter.ad.DeviceAdStrategyService; |
| | | import com.yeshi.buwan.service.inter.vip.VIPService; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.video.VideoConstant; |
| | | import com.yeshi.buwan.vo.video.VideoDetailVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private VIPService vipService; |
| | | |
| | | @Resource |
| | | private VideoInfoService videoInfoService; |
| | | |
| | | private DeviceAdStrategy init(String id, String deviceId, String detailSystemId) { |
| | | DeviceAdStrategy strategy = new DeviceAdStrategy(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void setVideoDetailAdStrategy(String deviceId, String detailSystemId, long fsaExpireTime, long pvaExpireTime) { |
| | | public VideoDetailVO.VideoAdInfo getVideoDetailAdStrategy(String deviceId, String detailSystemId, String loginUid, String videoId, String from) { |
| | | |
| | | VideoDetailVO.VideoAdInfo videoAdInfo = getVideoDetailAdStrategy(deviceId, detailSystemId, loginUid); |
| | | //从APP首页推荐而来,并且有全屏視頻廣告 |
| | | if (videoAdInfo.isFullVideo() && "recommend".equalsIgnoreCase(from)) { |
| | | //是否为4大分类 |
| | | VideoInfo videoInfo = videoInfoService.getVideoInfoCache(videoId); |
| | | //除开四大分类外不展示全屏视频广告 |
| | | if (videoInfo != null && videoInfo.getContentType() != null && videoInfo.getContentType() != 1) { |
| | | videoAdInfo.setFullVideo(false); |
| | | } |
| | | } |
| | | return videoAdInfo; |
| | | } |
| | | |
| | | @Override |
| | | public void setVideoDetailAdStrategy(String deviceId, String detailSystemId, Long fsaExpireTime, Long pvaExpireTime) { |
| | | if (StringUtil.isNullOrEmpty(deviceId) || StringUtil.isNullOrEmpty(detailSystemId)) { |
| | | return; |
| | | } |
| | |
| | | } |
| | | DeviceAdStrategy update = new DeviceAdStrategy(); |
| | | update.setId(id); |
| | | update.setDetailFSAExpireTime(fsaExpireTime); |
| | | update.setDetailPVAExpireTime(pvaExpireTime); |
| | | if (fsaExpireTime != null) |
| | | update.setDetailFSAExpireTime(fsaExpireTime); |
| | | if (pvaExpireTime != null) |
| | | update.setDetailPVAExpireTime(pvaExpireTime); |
| | | deviceAdStrategyDao.updateSelective(update); |
| | | } |
| | | } |