-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.txt
More file actions
132 lines (116 loc) · 2.9 KB
/
example.txt
File metadata and controls
132 lines (116 loc) · 2.9 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
1.这里有3台服务器的配置信息,包括URL、token
server1:
alias: east
url:live.xxx1.net
server2:
alias: west
url:live.xxx2.net
server3:
alias: hebei
url:live.xxx3.top
token: 是公共的配置
2.下面有一个接口请求示例,有请求题和响应体
2.1、获取所有的直播房间列表:
(1)请求
POST https://live.ours237.top/api/live/liveList
Content-Type: application/json
Token: ${token}
{"pageInfo":{"orderBy":"","pageNum":1,"pageSize":1000,"total":100,"pages":10},"param":{}}
(2)响应:
{
"meta": {
"success": true,
"code": "0000",
"message": "成功",
"processingTime": null
},
"data": [
{
"id": "1648194612419",
"name": "五会"
},
{
"id": "1663938648396",
"name": "6约-pm1"
},
{
"id": "1757924096604",
"name": "贰"
},
{
"id": "1683458146958",
"name": "回放"
},
{
"id": "1650157624065",
"name": "7日"
}
],
"pageInfo": {
"pageNum": 1,
"pageSize": 1000,
"total": 5,
"orderBy": "",
"pages": 1
}
}
2.2、刷新指定房间的直播校验码:
(1)请求
POST https://${url}/api/live/refreshVerifyCode
content-type:application/json
Token: ${token}
{"param":"${liveId}"}
(2)响应:
{
"meta": {
"success": true,
"code": "0000",
"message": "成功",
"processingTime": null
},
"data": {
"id": "10001",
"code": "7311",
"refreshCode": null,
},
"pageInfo": null
}
2.3、刷新指定多个房间房间的直播校验码:
liveIds:"1656683563461,1712113285566"
(1)请求
POST https://${url}/api/live/batchRefVerifyCode
content-type:application/json
Token: ${token}
{"param":"${liveIds}"}
(2)响应:
{
"meta": {
"success": true,
"code": "0000",
"message": "成功",
"processingTime": null
},
"data": "3200",
"pageInfo": null
}
2.4、我需要将三个服务器请求的结果汇聚成一个信息,发到这个地址上
curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${sendKey}' \
-H 'Content-Type: application/json' \
-d '
{
"msgtype": "text",
"text": {
"content": "【east】刷码成功\n
五会:7311\n
6约-pm1:8634\n
7日:8975"
}
}'
3、需求描述,
3.1、遍历配置的SERVER_URL_LIST,拼接API接口2.1地址
3.2、通过API接口2.1获取所有的直播房间列表,
3.3、然后通过我配置的LIVE_NAME_LIST中的名称,匹配列表数据中"data"->"name"过滤的直播数据,
3.4、解析得到的直播数据的"data"->"id"
3.5、通过API接口2.2 进行刷码,解析得到新的直播码 "data"->"code"
3.6、遍历所有匹配的直播数据进行刷码
3.7、最后获取SERVER_URL对应的SERVER_ALIAS,通过API接口2.3将本SERVER的刷码数据按照示例格式组装推送出去