live_api.ts
3.5 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
import { default as axios } from 'axios';
const api_url = process.env.VUE_APP_BASE_API;
const common_option = { headers: { 'Content-Type': 'application/json' } };
export async function live_score_all ({ limit, match_day, matchState, offset, lotIds }: any) {
const query = `
query{
liveScore(
limit:${limit || 20},
offset:${offset || 0},
lotIds:${JSON.stringify(lotIds || ['72', '45'])}
${match_day ? `,matchDay:"${match_day}"` : ''}
${matchState ? `,matchState:"${matchState}"` : ''}
){
count
matchs{
HostName
GuestName
GameName
Id
InfoId
WeekDay
ExpertsCount
IsJc
MatchTime
MatchNumber
YiqiuMatchId
QcBf
BcBf
MatchState
Sportsdt{
SportsdtMatchId
}
}
}
}
`;
return await axios.post(api_url+"/liveScore", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
}
export async function live_score_real_time ({ limit, match_day, matchState, offset, lotIds }: any) {
const query = `
query{
liveScore(
matchState:"${matchState || '进行中'}",
limit:${limit || 20},
offset:${offset || 0},
lotIds:${JSON.stringify(lotIds || ['72', '45'])}
${match_day ? `, matchDay:"${match_day}"` : ''}
){
count
matchs{
BcBf
QcBf
HostRed
GuestRed
MatchState
Id
InfoId
MatchTime
YiqiuMatchId
Weather
}
}
}
`;
return await axios.post(api_url+"/liveScore", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
}
export async function nm_match_list ({ match_date = "", issue_date = "", yiqiu_competition_id = 0, is_sample = 0 }) {
const query = `
query{
nm_match_list(
match_date:"${match_date}",
issue_date:"${issue_date}",
yiqiu_competition_id:${yiqiu_competition_id},
is_sample:${is_sample}
)
}
`;
return await axios.post(api_url+"/nm_match_list", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
}
export async function nm_match_live () {
const query = `
query{
nm_match_live
}
`;
return await axios.post(api_url+"/nm_match_live", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
}
export async function nm_match_set_attention (yiqiuid = 0, is_attention = 1) {
if (yiqiuid < 1) return;
const query = `
mutation{
nm_match_set_attention(
is_attention: ${is_attention}
yiqiu_match_id: ${yiqiuid}
)
}
`;
return await axios.post(api_url+"/nm_match_set_attention", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
}
export async function nm_match_attention_list ({ match_date = null, issue_date = "", yiqiu_competition_id = 0 }) {
if (!match_date) return;
const query = `
query{
nm_match_attention_list(
match_date: "${match_date}"
issue_date: "${issue_date}"
yiqiu_competition_id: ${yiqiu_competition_id}
)
}
`;
return await axios.post(api_url+"/nm_match_attention_list", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
}
export async function nm_competition_list () {
const query = `query{ nm_competition_list }`;
return await axios.post(api_url+"/nm_competition_list", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
}