feat: 评论点赞

This commit is contained in:
guozhigq
2023-07-24 20:01:10 +08:00
parent 7a3f6cf5ee
commit 1c744e3f59
5 changed files with 116 additions and 24 deletions

View File

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

View File

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