From 4011b8d0b377af33e2bc435f7726329630d706cb Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 02 三月 2021 18:28:52 +0800 Subject: [PATCH] 搜索引擎接口更新 --- src/test/java/com/hxh/spring/test/PPTVTest.java | 69 ++++++++++++++++++++++++++++++---- 1 files changed, 60 insertions(+), 9 deletions(-) diff --git a/src/test/java/com/hxh/spring/test/PPTVTest.java b/src/test/java/com/hxh/spring/test/PPTVTest.java index d1f415f..a17377a 100644 --- a/src/test/java/com/hxh/spring/test/PPTVTest.java +++ b/src/test/java/com/hxh/spring/test/PPTVTest.java @@ -1,8 +1,11 @@ package com.hxh.spring.test; +import com.yeshi.buwan.dao.juhe.pptv.PPTVSeriesDao; +import com.yeshi.buwan.job.video.PPTVVideoUpdate; import com.yeshi.buwan.pptv.PPTVApiUtil; import com.yeshi.buwan.pptv.PPTVUtil; import com.yeshi.buwan.pptv.entity.PPTVSeries; +import com.yeshi.buwan.service.inter.LoginUserService; import com.yeshi.buwan.service.inter.juhe.PPTVService; import org.junit.Test; import org.junit.runner.RunWith; @@ -14,18 +17,41 @@ import java.util.List; -//@RunWith(SpringJUnit4ClassRunner.class) //浣跨敤junit4杩涜娴嬭瘯 -//@ContextConfiguration(locations = {"classpath:spring.xml"}) -//@WebAppConfiguration +@RunWith(SpringJUnit4ClassRunner.class) //浣跨敤junit4杩涜娴嬭瘯 +@ContextConfiguration(locations = {"classpath:spring.xml"}) +@WebAppConfiguration public class PPTVTest { @Resource private PPTVService pptvService; + + @Resource + private PPTVSeriesDao pptvSeriesDao; + + @Resource + private PPTVVideoUpdate pptvVideoUpdate; + + @Resource + private LoginUserService loginUserService; + @Test - public void save() { - List<PPTVSeries> list = PPTVApiUtil.getUpdateList(); + public void saveAll() { + List<PPTVSeries> list = PPTVApiUtil.getTotalList(); pptvService.save(list); + } + + @Test + public void addToVideoInfo() { + List<PPTVSeries> list = pptvSeriesDao.list(2000, 1000); + for (PPTVSeries s : list) { + if (s.getProgramType().contains("灏戝効") || s.getProgramType2().contains("灏戝効")) { + continue; + } + System.out.println(s.getName() + ":" + s.getInfoID()); + PPTVSeries series = pptvService.getSeriesDetail(s.getInfoID()); + pptvService.addToVideoInfo(series); + } } @Test @@ -40,8 +66,12 @@ } @Test - public void getAll() { - PPTVApiUtil.getUpdateList(); + public void update() { + try { + pptvVideoUpdate.updateLatestVideo(""); + } catch (Exception e) { + e.printStackTrace(); + } } @@ -54,9 +84,30 @@ @Test public void getOpenId() { //CODE:XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg= - PPTVApiUtil.login("XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg="); +// PPTVApiUtil.login("XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg="); + String pptvUid = PPTVUtil.decryptPPTVCode("XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg=").pptvUid; + String openId = PPTVApiUtil.getOpenId(pptvUid); + System.out.println(openId); - PPTVApiUtil.getOpenId("buwan_766693"); +// try { +// loginUserService.updatePPTVOpenId("766693"); +// } catch (PPTVException e) { +// e.printStackTrace(); +// } + + } + + + @Test + public void getVIPPriceList() { + PPTVApiUtil.getVIPPriceList(); + } + + + @Test + public void addVideoInfo() { + PPTVSeries series = pptvService.getSeriesDetail("4205"); + pptvService.addToVideoInfo(series); } -- Gitblit v1.8.0