admin
2020-10-26 89e370bfdda29ac8a8f7080a18dc09a6ddc75c09
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
package com.hxh.spring.test;
 
import java.util.List;
 
import org.junit.Test;
 
import com.yeshi.buwan.dao.VideoInfoDao;
import com.yeshi.buwan.service.imp.StatisticsService;
import com.yeshi.buwan.util.BeanUtil;
import com.yeshi.buwan.util.news.SouGouParser;
 
public class StatisticTest {
    // @Test
    public void updateSouGou() {// SouGouParser
        SouGouParser souGouParser = (SouGouParser) BeanUtil.getBean("souGouParser");
        souGouParser.startParse();
    }
 
    // @Test
    public void refreshWatchCount() {
        StatisticsService statisticsService = (StatisticsService) BeanUtil.getBean("statisticsService");
        VideoInfoDao videoInfoDao = (VideoInfoDao) BeanUtil.getBean("videoInfoDao");
        for (int p = 2; p < 10; p++) {
            System.out.println("页码:" + p);
            List list = videoInfoDao.sqlList("select id from wk_video_video", (p - 1) * 10000, 10000, null);
            for (int j = 0; j < list.size(); j++) {
                statisticsService.refreshWatchCount(list.get(j) + "");
                statisticsService.refreshVideoCommentCount(list.get(j) + "");
                // statisticsService.refreshVideoDetailCount(list.get(j) + "");
            }
        }
    }
 
    // @Test
    public void refreshCommentCount() {
 
    }
 
    @Test
    public void playStatistics() {
        final StatisticsService statisticsService = (StatisticsService) BeanUtil.getBean("statisticsService");
        statisticsService.categoryPlayStatistic();
    }
 
}