mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-17 07:36:14 +08:00
feat: match info
opt dateformat Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
22
lib/http/match.dart
Normal file
22
lib/http/match.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models_new/match/match_info/contest.dart';
|
||||
import 'package:PiliPlus/models_new/match/match_info/data.dart';
|
||||
|
||||
class MatchHttp {
|
||||
static Future<LoadingState<MatchContest?>> matchInfo(dynamic cid) async {
|
||||
var res = await Request().get(
|
||||
Api.matchInfo,
|
||||
queryParameters: {
|
||||
'cid': cid,
|
||||
'platform': 2,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(MatchInfoData.fromJson(res.data['data']).contest);
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user