feat: thumbsdown reply

This commit is contained in:
bggRGjQaUbCoE
2024-10-09 09:41:54 +08:00
parent 03b2a3ced3
commit 0c8ac833a2
5 changed files with 129 additions and 36 deletions

View File

@@ -143,6 +143,8 @@ class Api {
// 评论点赞
static const String likeReply = '/x/v2/reply/action';
static const String hateReply = '/x/v2/reply/hate';
// 发表评论
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/comment/action.md
static const String replyAdd = '/x/v2/reply/add';

View File

@@ -83,6 +83,36 @@ class ReplyHttp {
}
}
static Future hateReply({
required int type,
required int action,
required int oid,
required int rpid,
}) async {
var res = await Request().post(
Api.hateReply,
data: {
'type': type,
'oid': oid,
'rpid': rpid,
'action': action,
'csrf': await Request.getCsrf(),
},
options: Options(
contentType: Headers.formUrlEncodedContentType,
),
);
if (res.data['code'] == 0) {
return {'status': true, 'data': res.data['data']};
} else {
return {
'status': false,
'date': [],
'msg': res.data['message'],
};
}
}
// 评论点赞
static Future likeReply({
required int type,