DYController.java
2.07 KB
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
package cn.fw.freya.controller;
import cn.fw.freya.model.data.LiveOverview;
import cn.fw.freya.model.data.pool.LivePool;
import cn.fw.freya.model.data.pool.VideoPool;
import cn.fw.freya.model.dto.rpc.ReportAccountDto;
import cn.fw.freya.service.crawl.impl.DouYinCrawl;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author unknown
* @version 1.0
* @date 2021/12/7 9:53
* @Description
*/
@Validated
@RequestMapping("/douyin")
@RestController
@RequiredArgsConstructor
public class DYController {
private final DouYinCrawl douyinCrawl;
/**
* 获取所有'作品'信息, 并存库
*
* @param accountNo 账户号
*/
@GetMapping("/getVideoInfo")
public List<VideoPool> getVideoInfo(String accountNo) {
return douyinCrawl.getAllVideoMsg(accountNo);
}
/**
* 获取昨天所有'直播'数据总览, 并存库
*
* @param accountNo 账户号
*/
@GetMapping("/getLiveInfo")
public LiveOverview getLiveInfo(String accountNo) {
return douyinCrawl.getYesterdayLiveOverview(accountNo);
}
/**
* 获取昨天所有'直播'信息, 并存库
*
* @param accountNo 账户号
*/
@GetMapping("/getYesterdayLiveMsg")
public List<LivePool> getYesterdayLiveMsg(String accountNo) {
return douyinCrawl.getYesterdayLiveMsg(accountNo);
}
/**
* 更新账户粉丝信息
*
* @param accountNo 账户号
*/
@GetMapping("/updateAccountFans")
public ReportAccountDto updateAccountFans(String accountNo) {
return douyinCrawl.updateAccountMsg(accountNo);
}
/**
* 进入指定账户号的创作者平台首页
*
* @param accountNo 账户号
*/
@GetMapping("/loginIndex")
public void loginIndex(String accountNo) {
douyinCrawl.loginIndex(accountNo);
}
}