admin
2021-02-19 58577bae968f2a10232bc8b3c04910b93ea3c69a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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 org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
 
import javax.annotation.Resource;
import java.util.List;
 
 
//@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() {
        List<PPTVSeries> list = PPTVApiUtil.getUpdateList();
        pptvService.save(list);
    }
 
    @Test
    public void getDetail() {
        PPTVSeries pptvSeries = pptvService.getSeriesDetail("201161");
        System.out.println(pptvSeries);
    }
 
    @Test
    public void test() {
        PPTVApiUtil.getOpenId("123");
    }
 
    @Test
    public void getAll() {
        PPTVApiUtil.getUpdateList();
    }
 
 
    @Test
    public void getApiDetail() {
        PPTVApiUtil.getDetail("32159127,10215224,15326213");
    }
 
 
    @Test
    public void getOpenId() {
        //CODE:XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg=
//        PPTVApiUtil.login("XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg=");
        String pptvUid = PPTVUtil.decryptPPTVCode("XefbSM0H8BC9kaEGEjHF2U7wd6Sd9ec1oSUmG1gZDTg=").pptvUid;
        String openId = PPTVApiUtil.getOpenId(pptvUid);
        System.out.println(openId);
 
//        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);
    }
 
 
}