mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: set top reply
Closes #589 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -747,4 +747,6 @@ class Api {
|
||||
static const String delFavArticle = '/x/article/favorites/del';
|
||||
|
||||
static const String addFavArticle = '/x/article/favorites/add';
|
||||
|
||||
static const String replyTop = '/x/v2/reply/top';
|
||||
}
|
||||
|
||||
@@ -399,4 +399,30 @@ class ReplyHttp {
|
||||
return LoadingState.error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future replyTop({
|
||||
required oid,
|
||||
required type,
|
||||
required rpid,
|
||||
required bool isUpTop,
|
||||
}) async {
|
||||
var res = await Request().post(
|
||||
Api.replyTop,
|
||||
data: {
|
||||
'oid': oid,
|
||||
'type': type,
|
||||
'rpid': rpid,
|
||||
'action': isUpTop ? 0 : 1,
|
||||
'csrf': await Request.getCsrf(),
|
||||
},
|
||||
options: Options(
|
||||
contentType: Headers.formUrlEncodedContentType,
|
||||
),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user