feat: 评论点赞
This commit is contained in:
@ -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';
|
||||
|
@ -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'],
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user