admin
2021-02-06 e2c6372f29ae0a93d9f672ffad4613581ba3e201
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
package com.hxh.spring.test;
 
import java.util.ArrayList;
import java.util.List;
 
import org.junit.Test;
 
import com.newvideo.service.imp.zhibo.LJFLiveService;
import com.newvideo.service.imp.zhibo.ZhiBoServcie;
import com.newvideo.util.BeanUtil;
import com.newvideo.zhibo.ljf.LiuJianFangApi;
import com.newvideo.zhibo.ljf.entity.LJFLiveData;
 
public class ZhiBo {
    @Test
    public static void liuJianFangTest() {
        LJFLiveService service = BeanUtil.getBean(LJFLiveService.class);
        List<LJFLiveData> list = new ArrayList<LJFLiveData>();
        for (int p = 1; p < 50; p++) {
//            try {
//                Thread.sleep(1000);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
            List<LJFLiveData> li = (LiuJianFangApi.liveList("", p));
            if (li != null && li.size() > 0)
                list.addAll(li);
        }
        service.updateData(list);
    }
 
    public static void main(String[] args) {
        liuJianFangTest();
    }
 
    // @Test
    public static void getTop10() {
        ZhiBoServcie service = BeanUtil.getBean(ZhiBoServcie.class);
        service.getTop10List();
    }
}