BLBLController.java
1.84 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
package cn.fw.freya.controller;
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.BilibiliCrawl;
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.io.IOException;
import java.util.List;
/**
* @author unknown
* @version 1.0
* @date 2021/12/10 14:56
* @Description
*/
@Validated
@RequestMapping("/bilibili")
@RestController
@RequiredArgsConstructor
public class BLBLController {
private final BilibiliCrawl bilibiliCrawl;
/**
* 获取所有'作品'信息, 并存库
*
* @param accountNo 账户号
*/
@GetMapping("/getVideoInfo")
public List<VideoPool> getVideoInfo(String accountNo) throws IOException {
return bilibiliCrawl.getAllVideoMsg(accountNo);
}
/**
* 获取所有'直播'信息, 并存库
*
* @param accountNo 账户号
*/
@GetMapping("/getLiveInfo")
public List<LivePool> getLiveInfo(String accountNo) throws IOException {
return bilibiliCrawl.getYesterdayLiveMsg(accountNo);
}
/**
* 更新用户粉丝数
*
* @param accountNo 账户号
*/
@GetMapping("/updateAccountFans")
public ReportAccountDto updateAccountFans(String accountNo) throws IOException {
return bilibiliCrawl.updateAccountMsg(accountNo);
}
/**
* 进入指定账户号的创作者平台首页
*
* @param accountNo 账户号
*/
@GetMapping("/loginIndex")
public void loginIndex(String accountNo) {
bilibiliCrawl.loginIndex(accountNo);
}
}