| | |
| | | import com.yeshi.buwan.dao.video.AlbumVideoMapDao; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.solr.SolrAlbumVideo; |
| | | import com.yeshi.buwan.domain.solr.SolrShortVideo; |
| | | import com.yeshi.buwan.domain.video.AlbumVideoMap; |
| | | import com.yeshi.buwan.domain.video.InternetSearchVideo; |
| | | import com.yeshi.buwan.dto.search.SolrResultDTO; |
| | | import com.yeshi.buwan.dto.search.SolrShortVideoSearchFilter; |
| | | import com.yeshi.buwan.dto.search.SolrVideoSearchFilter; |
| | | import com.yeshi.buwan.pptv.PPTVUtil; |
| | | import com.yeshi.buwan.service.imp.VideoInfoService; |
| | | import com.yeshi.buwan.service.inter.juhe.AlbumVideoMapService; |
| | | import com.yeshi.buwan.service.inter.juhe.InternetSearchVideoService; |
| | | import com.yeshi.buwan.service.manager.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.SolrCommonVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.SolrInternetSearchVideoDataManager; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.service.manager.search.SolrAlbumVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrInternetSearchVideoDataManager; |
| | | import com.yeshi.buwan.service.manager.search.SolrShortVideoDataManager; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.factory.VideoInfoFactory; |
| | | import com.yeshi.buwan.util.video.VideoConstant; |
| | | import net.sf.json.JSONObject; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | |
| | | |
| | | @Resource |
| | | private SolrInternetSearchVideoDataManager solrInternetSearchVideoDataManager; |
| | | |
| | | @Resource |
| | | private SolrShortVideoDataManager solrShortVideoDataManager; |
| | | |
| | | @Resource |
| | | private InternetSearchVideoService internetSearchVideoService; |
| | |
| | | |
| | | @Test |
| | | public void addInternet() { |
| | | InternetSearchVideo list = internetSearchVideoService.selectByPrimaryKey("59fafccefd20505b0aade6d9ba0e8ed1"); //listAll(1, 10); |
| | | InternetSearchVideo list = internetSearchVideoService.selectByPrimaryKey("38ac0127d0cc3433e09964e757ab3505"); //listAll(1, 10); |
| | | solrInternetSearchVideoDataManager.saveOrUpdate(list); |
| | | } |
| | | |
| | | @Test |
| | | public void deleteInternet() { |
| | | String st = "161469b4aa35ca7ae1cc5d3ddaa23276,3b57b603b4eef496ce0de50f06ca40c0"; |
| | | |
| | | |
| | | for (String id : st.split(",")) |
| | | solrInternetSearchVideoDataManager.deleteById(id); |
| | | } |
| | | |
| | | |
| | |
| | | // solrDataManager.clear(); |
| | | // } |
| | | |
| | | @Resource |
| | | private com.yeshi.buwan.job.video.ShortVideoUpdateJob shortVideoUpdateJob; |
| | | |
| | | @Test |
| | | public void iqiyiShortVideo() { |
| | | |
| | | JSONObject params = new JSONObject(); |
| | | params.put("videoType", 155); |
| | | params.put("url", "https://list.iqiyi.com/www/7/186-------------24-1-2-iqiyi--.html?s_source=PCW_LC"); |
| | | |
| | | try { |
| | | shortVideoUpdateJob.updateIqiyiShortVideo(params.toString()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | | //https://v.qq.com/channel/ent?_all=1&channel=ent&iarea=2&listpage=1&sort=40 |
| | | @Test |
| | | public void tencentShortVideo() { |
| | | JSONObject params = new JSONObject(); |
| | | params.put("videoType", 155); |
| | | params.put("area", "日韩"); |
| | | params.put("url", "https://v.qq.com/channel/ent?_all=1&channel=ent&iarea=2&listpage=1&sort=40"); |
| | | |
| | | try { |
| | | shortVideoUpdateJob.updateTencentShortVideo(params.toString()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void clearShortVideo() { |
| | | SolrShortVideoSearchFilter filter = new SolrShortVideoSearchFilter(); |
| | | for (int i = 0; i < 4; i++) { |
| | | SolrResultDTO dto = solrShortVideoDataManager.find(filter, 1, 500); |
| | | List<SolrShortVideo> list = (List<SolrShortVideo>) dto.getVideoList(); |
| | | for (SolrShortVideo video : list) { |
| | | solrShortVideoDataManager.deleteById(video.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void addToAlbum() { |
| | | albumVideoMapService.add(videoInfoService.getVideoInfo("8441251")); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void getById() { |
| | | |
| | | SolrAlbumVideo solrAlbumVideo = solrDataManager.findOne("8441251"); |
| | | System.out.println(solrAlbumVideo); |
| | | } |
| | | |
| | | } |