mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: pgc timeline
Closes #653 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -760,4 +760,6 @@ class Api {
|
||||
|
||||
static const String getLiveEmoticons =
|
||||
'${HttpString.liveBaseUrl}/xlive/web-ucenter/v2/emoticon/GetEmoticons';
|
||||
|
||||
static const String pgcTimeline = '/pgc/web/timeline';
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/bangumi/pgc_timeline/pgc_timeline.dart';
|
||||
import 'package:PiliPlus/models/bangumi/pgc_timeline/result.dart';
|
||||
|
||||
import '../models/bangumi/list.dart';
|
||||
import '../models/bangumi/pgc_index/condition.dart';
|
||||
@@ -86,4 +88,24 @@ class BangumiHttp {
|
||||
return LoadingState.error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<List<Result>?>> pgcTimeline({
|
||||
int types = 1, // 1:`番剧`<br />3:`电影`<br />4:`国创` |
|
||||
required int before,
|
||||
required int after,
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
Api.pgcTimeline,
|
||||
queryParameters: {
|
||||
'types': types,
|
||||
'before': before,
|
||||
'after': after,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return LoadingState.success(PgcTimeline.fromJson(res.data).result);
|
||||
} else {
|
||||
return LoadingState.error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user