| | |
| | | package com.hxh.spring.test; |
| | | |
| | | import com.yeshi.buwan.exception.PPTVException; |
| | | 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; |
| | |
| | | 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 LoginUserService loginUserService; |
| | | |
| | | @Test |
| | | public void save() { |
| | |
| | | @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("9847"); |
| | | System.out.println(series); |
| | | } |
| | | |
| | | |