| | |
| | | import com.yeshi.buwan.job.video.TencentVideoUpdate; |
| | | import com.yeshi.buwan.service.inter.juhe.InternetSearchVideoService; |
| | | import com.yeshi.buwan.service.inter.juhe.TencentVideoService; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.videos.tencent.entity.TencentCoverInfo; |
| | | import org.json.JSONObject; |
| | | import org.junit.Test; |
| | |
| | | import org.springframework.test.context.ContextConfiguration; |
| | | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
| | | import org.springframework.test.context.web.WebAppConfiguration; |
| | | import org.springframework.util.StopWatch; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | @Resource |
| | | private TencentVideoUpdate tencentVideoUpdate; |
| | | |
| | | |
| | | @Resource |
| | | private InternetSearchVideoService internetSearchVideoService; |
| | | |
| | | |
| | | @Test |
| | | public void test2() { |
| | | Constant.IsOutNet = false; |
| | | try { |
| | | tencentVideoUpdate.updateLatestVideo("动漫"); |
| | | tencentVideoUpdate.updateCategory("电影",1,1,null); |
| | | tencentVideoUpdate.updateCategory("电视剧",1,1,null); |
| | | tencentVideoUpdate.updateCategory("动漫",1,1,null); |
| | | // TencentCoverInfo coverInfo = tencentVideoService.getSimpleCoverDetail("m441e3rjq9kwpsc"); |
| | | // System.out.println(coverInfo.toString()); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void testAddHanJu() { |
| | | Constant.IsOutNet = false; |
| | | try { |
| | | // tencentVideoUpdate.updateCategory("电影",1,9,100028); |
| | | tencentVideoUpdate.updateCategory("电视剧",1,1,5); |
| | | // TencentCoverInfo coverInfo = tencentVideoService.getSimpleCoverDetail("m441e3rjq9kwpsc"); |
| | | // System.out.println(coverInfo.toString()); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | |
| | | @Test |
| | | public void addToSearch() { |
| | | List<TencentCoverInfo> list = tencentVideoService.list("动漫", 1, 10); |
| | | Constant.IsOutNet = false; |
| | | List<TencentCoverInfo> list = tencentVideoService.list(null, 1, 1000); |
| | | for (TencentCoverInfo info : list) { |
| | | try { |
| | | tencentVideoService.addToInternetSearch(info); |
| | | tencentVideoService.addToInternetSearch(info, false); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | @Test |
| | | public void clearOffLine(){ |
| | | Constant.IsOutNet = false; |
| | | tencentVideoService.clearOfflineCovers(); |
| | | } |
| | | |
| | | |
| | | } |