| | |
| | | import com.yeshi.buwan.iqiyi.entity.VideoIqiyi2; |
| | | import com.yeshi.buwan.iqiyi.util.IqiyiUtil; |
| | | import com.yeshi.buwan.iqiyi.util.IqiyiUtil2; |
| | | import com.yeshi.buwan.query.Iqiyi2AlbumQuery; |
| | | import com.yeshi.buwan.service.imp.CategoryVideoService; |
| | | import com.yeshi.buwan.service.imp.ResourceVideoService; |
| | | import com.yeshi.buwan.service.imp.VideoInfoService; |
| | |
| | | import com.yeshi.buwan.service.inter.juhe.Iqiyi2Service; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.TimeUtil; |
| | | import com.yeshi.buwan.util.log.VideoLogFactory; |
| | | import com.yeshi.buwan.util.mq.CMQManager; |
| | | import com.yeshi.buwan.util.video.VideoConstant; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Service |
| | | public class Iqiyi2ServiceImpl implements Iqiyi2Service { |
| | | |
| | | private final Logger logger = LoggerFactory.getLogger("videoUpdate"); |
| | | |
| | | @Resource |
| | | private VideoIqiyi2Dao videoIqiyi2Dao; |
| | | |
| | |
| | | } else {//专辑 |
| | | //判断period字段是否为空 |
| | | int sort = album.isSourceAlbum() ? IqiyiAlbum2.SORT_PERIOD : IqiyiAlbum2.SORT_ORDER; |
| | | List<IqiyiAlbum2> list = iqiyiAlbum2Dao.listByAid(album.getId(), sort, (page - 1) * pageSize, pageSize); |
| | | Iqiyi2AlbumQuery query = new Iqiyi2AlbumQuery(); |
| | | query.setFeatureAlbumId(album.getId()); |
| | | query.setContentType(1); |
| | | List<IqiyiAlbum2> list = iqiyiAlbum2Dao.listByAid(query, sort, (page - 1) * pageSize, pageSize); |
| | | if (list != null) |
| | | album2List.addAll(list); |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | logger.info(VideoLogFactory.createAddToVideoLog(album)); |
| | | |
| | | VideoInfo newVideoInfo = convertAlbumToVideoInfo(album); |
| | | VideoIqiyi2 videoIqiyi2 = videoIqiyi2Dao.selectByIqiyiId(album.getId()); |
| | |
| | | public long countById(Long id) { |
| | | return iqiyiAlbum2Dao.countById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByAid(long id) { |
| | | long count = iqiyiAlbum2Dao.countById(id); |
| | | if (count > 0) { |
| | | iqiyiAlbum2Dao.delete(id); |
| | | } |
| | | VideoIqiyi2 bean = videoIqiyi2Dao.selectByIqiyiId(id); |
| | | if (bean != null) { |
| | | videoIqiyi2Dao.delete(bean.getVideoId()); |
| | | //删除资源 |
| | | resourceVideoService.delete(bean.getVideoId() + "", IqiyiUtil2.RESOURCE_ID + ""); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<IqiyiAlbum2> listByIds(List<Long> idsList) { |
| | | return iqiyiAlbum2Dao.listByIds(idsList); |
| | | } |
| | | } |