mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: load total replies without login
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import '../models/video/reply/data.dart';
|
||||
import '../models/video/reply/emote.dart';
|
||||
import 'api.dart';
|
||||
import 'constants.dart';
|
||||
import 'init.dart';
|
||||
|
||||
class ReplyHttp {
|
||||
static final _dio = Dio();
|
||||
static Future replyList({
|
||||
required int oid,
|
||||
required String nextOffset,
|
||||
required int type,
|
||||
int sort = 1,
|
||||
}) async {
|
||||
var res = await Request().get(Api.replyList, data: {
|
||||
try {
|
||||
var res = await _dio
|
||||
.get('${HttpString.apiBaseUrl}${Api.replyList}', queryParameters: {
|
||||
'oid': oid,
|
||||
'type': type,
|
||||
'pagination_str': '{"offset":"${nextOffset.replaceAll('"', '\\"')}"}',
|
||||
@@ -28,6 +34,13 @@ class ReplyHttp {
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
return {
|
||||
'status': false,
|
||||
'date': [],
|
||||
'msg': e.toString(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static Future replyReplyList({
|
||||
@@ -37,7 +50,9 @@ class ReplyHttp {
|
||||
required int type,
|
||||
int sort = 1,
|
||||
}) async {
|
||||
var res = await Request().get(Api.replyReplyList, data: {
|
||||
try {
|
||||
var res = await _dio.get('${HttpString.apiBaseUrl}${Api.replyReplyList}',
|
||||
queryParameters: {
|
||||
'oid': oid,
|
||||
'root': root,
|
||||
'pn': pageNum,
|
||||
@@ -57,6 +72,13 @@ class ReplyHttp {
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
return {
|
||||
'status': false,
|
||||
'date': [],
|
||||
'msg': e.toString(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 评论点赞
|
||||
@@ -87,7 +109,6 @@ class ReplyHttp {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static Future getEmoteList({String? business}) async {
|
||||
var res = await Request().get(Api.myEmote, data: {
|
||||
'business': business ?? 'reply',
|
||||
|
||||
Reference in New Issue
Block a user