| | |
| | | package com.hxh.spring.test; |
| | | |
| | | import com.yeshi.buwan.dao.juhe.iqiyi.IqiyiAlbum2Dao; |
| | | import com.yeshi.buwan.iqiyi.IqiYiNewAPI; |
| | | import com.yeshi.buwan.iqiyi.entity.IqiyiAlbum2; |
| | | import com.yeshi.buwan.iqiyi.util.IqiyiUtil2; |
| | | import com.yeshi.buwan.service.inter.juhe.Iqiyi2Service; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.test.context.ContextConfiguration; |
| | |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | // |
| | | @RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试 |
| | | @ContextConfiguration(locations = {"classpath:spring.xml"}) |
| | | @WebAppConfiguration |
| | |
| | | @Resource |
| | | private IqiyiAlbum2Dao iqiyiAlbum2Dao; |
| | | |
| | | @Resource |
| | | private Iqiyi2Service iqiyi2Service; |
| | | |
| | | |
| | | @Test |
| | | public void syncAll() { |
| | | iqiyiUtil2.syncAllDianShiJu(); |
| | | iqiyiUtil2.syncAllZongYi(); |
| | | } |
| | | |
| | | @Test |
| | | public void syncDongMan() { |
| | | iqiyiUtil2.syncAllDongMan(); |
| | | } |
| | | |
| | | @Test |
| | | public void addToVideoInfo() { |
| | | IqiyiAlbum2 album = iqiyiAlbum2Dao.get(90023000L); |
| | | iqiyiUtil2.addToVideoInfo(album); |
| | | List<IqiyiAlbum2> list = iqiyiAlbum2Dao.listByChannelId(1, null, 1,11000, 3000); |
| | | for (IqiyiAlbum2 album : list) |
| | | try { |
| | | iqiyi2Service.addToVideoInfo(album); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void syncOne() { |
| | | iqiyiUtil2.syncByAid(247738801L); |
| | | iqiyiUtil2.syncByAid(253393601L); |
| | | iqiyiUtil2.syncByAid(253305701L); |
| | | iqiyiUtil2.syncByAid(247742201L); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void getIdFromUrl() { |
| | | String id = "240793601"; |
| | | List<Long> list = new ArrayList<>(); |
| | | list.add(Long.parseLong(id)); |
| | | List<IqiyiAlbum2> album2List = IqiYiNewAPI.getAlbumOrVideoDetail(list); |
| | | System.out.println(album2List); |
| | | |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void syncByAid() { |
| | | |
| | | Long[] ids = new Long[]{ |
| | | 246508201L, 248886801L, 230798901L, 1569537751867101L, |
| | | |
| | | |
| | | }; |
| | | |
| | | iqiyiUtil2.syncByAid(240793601L); |
| | | |
| | | // IqiyiAlbum2 album2 = iqiyi2Service.selectAlbumById(240793601L); |
| | | // if (album2 != null) { |
| | | // iqiyi2Service.addToVideoInfo(album2); |
| | | // } |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void updateLatest() { |
| | | List<String> urlList = IqiyiUtil2.getAlbumUrlsFromUrl("https://list.iqiyi.com/www/2/15-------------11-1-1-iqiyi--.html?s_source=PCW_LC"); |
| | | for (String url : urlList) { |
| | | String aid = IqiYiNewAPI.getAidByUrl(url); |
| | | iqiyiUtil2.syncByAid(Long.parseLong(aid)); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void test6() { |
| | | List<IqiyiAlbum2> list = iqiyiAlbum2Dao.listByChannelId(1, null, 1, 0, 1000); |
| | | for (IqiyiAlbum2 album : list) |
| | | System.out.println(album.getName()); |
| | | } |
| | | |
| | | |
| | | } |