game_api.ts
9.4 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
import { default as axios } from 'axios';
const api_url = process.env.VUE_APP_BASE_API;
const common_option = { headers: { 'Content-Type': 'application/json' } };
axios.defaults.timeout = 1000 * 20;
//获取赛事详情接口
export async function get_soccer_game_info({ yiqiu_id = 0, info_id = 0, game_id = 0 }: any) {
if(!yiqiu_id||yiqiu_id=='0'){
return {}
}
const query = `
query{
get_soccer_game_info(yiqiu_id:${yiqiu_id},info_id:${info_id},game_id:${game_id})
}
`;
let result = await axios.post(api_url+"/get_soccer_game_info", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let game = result?.data?.data?.get_soccer_game_info;
if (game == null || game.error != null) {
return {};
}
return game;
}
//本场单关专家_分页
export async function get_expert_schemes_list({ yiqiu_id = 0, pageIndex = 1, pageSize = 10}: any){
if(!yiqiu_id||yiqiu_id=='0'){
return {}
}
const query = `
query{
get_expert_schemes(yiqiu_game_id:${yiqiu_id}, page_size: ${pageSize}, page_index: ${pageIndex})
}
`;
let result = await axios.post(api_url+"/get_expert_schemes_list", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.get_expert_schemes;
if (data?.result?.data_list) {
data.result.data_list = data.result.data_list?.filter?.((item: any) => item?.type1 != '千嗨资讯');
}
return data;
}
//本场串关和胜平负专家_分页
export async function get_expert_schemes_and_2c1_list({ yiqiu_id = 0, pageIndex = 1, pageSize = 10}: any){
if(!yiqiu_id||yiqiu_id=='0'){
return {}
}
const query = `
query{
get_expert_schemes(yiqiu_game_id:${yiqiu_id}, page_size: ${pageSize}, page_index: ${pageIndex})
get_game_2c1_list(yiqiu_id:${yiqiu_id})
}
`;
let result = await axios.post(api_url+"/get_expert_schemes_2c1", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data;
return data;
}
//nm_team_point_rank 球队联赛积分排名
export async function nm_competition_team_point_rank_list({ yiqiu_id = 0 }: any) {
if(!yiqiu_id||yiqiu_id=='0'){
return {}
}
const query = `
query{
nm_competition_team_point_rank_list(yiqiu_id:${yiqiu_id})
}
`;
let result = await axios.post(api_url+"/nm_competition_team_point_rank_list", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.nm_competition_team_point_rank_list;
return data;
}
//nm_team_point_rank 积分排名
export async function nm_team_point_rank({ yiqiu_id = 0 }: any) {
if(!yiqiu_id||yiqiu_id=='0'){
return {}
}
const query = `
query{
nm_team_point_rank(yiqiu_id:${yiqiu_id})
}
`;
let result = await axios.post(api_url+"/nm_team_point_rank", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.nm_team_point_rank;
return data;
}
//获取赛事详情和纳米数据详情
export async function get_soccer_game_info_and_nm_match_detail({ yiqiu_id = 0, info_id = 0, game_id = 0 }: any) {
if(!yiqiu_id||yiqiu_id=='0'){
return {}
}
const query = `
query{
get_soccer_game_info(yiqiu_id:${yiqiu_id},info_id:${info_id},game_id:${game_id})
nm_match_detail(yiqiu_match_id:${yiqiu_id})
}
`;
let result = await axios.post(api_url+"/get_soccer_game_info_nm_detail", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let game = result?.data?.data;
if (game == null || game.error != null) {
return {};
}
return game;
}
//getgamegoaldata 赛况直播接口
export async function get_game_goal_data({ game_id = 0 }: any) {
const query = `
query{
getgamegoaldata(gameid:${game_id})
}
`;
let result = await axios.post(api_url+"/getgamegoaldata", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let getgamegoaldata = result?.data?.data?.getgamegoaldata;
if (getgamegoaldata == null || getgamegoaldata.error != null) {
return {};
}
return getgamegoaldata;
}
//getgameprediction 预测和阵容
export async function get_soccer_game_prediction({ game_id = 0 }: any) {
const query = `
query{
getgameprediction(gameid:${game_id})
}
`;
let result = await axios.post(api_url+"/getgameprediction", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let game = result?.data?.data?.getgameprediction;
if (game == null || game.error != null) {
return {};
}
return game;
}
//get_sporttery_pool 竞彩奖金接口
export async function get_sporttery_pool({ sporttery_id = 0 }: any) {
const query = `
query{
get_sporttery_pool(sporttery_id:${sporttery_id})
}
`;
let result = await axios.post(api_url+"/get_sporttery_pool", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.get_sporttery_pool;
return data;
}
//getgameanalyse 分析接口
export async function get_game_analyse({ game_id = 0 }: any) {
const query = `
query{
getgameanalyse(gameid:${game_id})
}
`;
let result = await axios.post(api_url+"/getgameanalyse", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.getgameanalyse;
return data;
}
//getcompetitionstanding 积分接口
export async function get_competition_standing({ competition_id = 0 }: any) {
const query = `
query{
getcompetitionstanding(competitionid:${competition_id})
}
`;
let result = await axios.post(api_url+"/getcompetitionstanding", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.getcompetitionstanding;
return data;
}
//getcompetitionschedule
export async function get_competition_schedule({ competition_id = 0 }: any) {
const query = `
query{
getcompetitionschedule(competitionid:${competition_id}){
Mode
SubMode
Team
Schedule
Competition
Period
}
}
`;
let result = await axios.post(api_url+"/getcompetitionschedule", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.getcompetitionschedule;
return data;
}
//本场模型预测数据接口(非vip情况)
export async function get_predict_datas(){
const query = `
query{
get_predict_datas
}
`;
let result = await axios.post(api_url+"/get_predict_datas", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.get_predict_datas;
return data;
}
//本场赛事预测接口 vip
export async function get_game_ssyc_detail({yiqiu_id = 0}:any) {
const query = `
query{
get_game_ssyc_detail(yiqiu_id:${yiqiu_id})
}
`;
let result = await axios.post(api_url+"/get_game_ssyc_detail", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.get_game_ssyc_detail;
return data;
}
//本场牛牛解球接口 vip
export async function get_game_nnjq_detail({yiqiu_id = 0}:any) {
const query = `
query{
get_game_nnjq_detail(yiqiu_id:${yiqiu_id})
}
`;
let result = await axios.post(api_url+"/get_game_nnjq_detail", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.get_game_nnjq_detail;
return data;
}
//本场海外预测接口 vip
export async function get_game_hwyc_detail({yiqiu_id = 0}:any) {
const query = `
query{
get_game_hwyc_detail(yiqiu_id:${yiqiu_id})
}
`;
let result = await axios.post(api_url+"/get_game_hwyc_detail", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.get_game_hwyc_detail;
return data;
}
//本场单关专家
export async function get_expert_schemes({ yiqiu_id = 0}: any){
const query = `
query{
get_expert_schemes(yiqiu_game_id:${yiqiu_id})
}
`;
let result = await axios.post(api_url+"/get_expert_schemes", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.get_expert_schemes;
return data;
}
//本场串关专家
export async function get_game_2c1_list({ yiqiu_id = 0}: any) {
const query = `
query{
get_game_2c1_list(yiqiu_id:${yiqiu_id})
}
`;
let result = await axios.post(api_url+"/get_game_2c1_list", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.get_game_2c1_list;
return data;
}
//本场串关和胜平负专家
export async function get_expert_schemes_and_2c1({ yiqiu_id = 0}: any){
const query = `
query{
get_expert_schemes(yiqiu_game_id:${yiqiu_id})
get_game_2c1_list(yiqiu_id:${yiqiu_id})
}
`;
let result = await axios.post(api_url+"/get_expert_schemes_2c1_list", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data;
return data;
}
//本场赔率
export async function get_game_odds({ yiqiu_id = 0, game_id = 0}: any) {
const query = `
query{
get_game_odds(yiqiu_id:${yiqiu_id},game_id:${game_id})
}
`;
let result = await axios.post(api_url+"/get_game_odds", `{"query":${JSON.stringify(query)},"variables":null}`, common_option);
let data = result?.data?.data?.get_game_odds;
return data;
}