refactor: bangumi intro

This commit is contained in:
bggRGjQaUbCoE
2024-09-12 17:47:58 +08:00
parent 5a72da5085
commit 8197bf116d
7 changed files with 94 additions and 78 deletions

View File

@@ -146,6 +146,22 @@ class SearchHttp {
}
}
static Future<LoadingState> bangumiInfoNew({int? seasonId, int? epId}) async {
final dynamic res = await Request().get(
Api.bangumiInfo,
data: {
if (seasonId != null) 'season_id': seasonId,
if (epId != null) 'ep_id': epId,
},
);
if (res.data['code'] == 0) {
return LoadingState.success(
BangumiInfoModel.fromJson(res.data['result']));
} else {
return LoadingState.error(res.data['message']);
}
}
static Future<Map<String, dynamic>> bangumiInfo(
{int? seasonId, int? epId}) async {
final Map<String, dynamic> data = {};