mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 17:46:24 +08:00
opt pgc review
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -865,4 +865,8 @@ class Api {
|
||||
static const String pgcReviewDislike = '/pgc/review/action/dislike';
|
||||
|
||||
static const String pgcReviewPost = '/pgc/review/short/post';
|
||||
|
||||
static const String pgcReviewMod = '/pgc/review/short/modify';
|
||||
|
||||
static const String pgcReviewDel = '/pgc/review/short/del';
|
||||
}
|
||||
|
||||
@@ -200,4 +200,48 @@ class BangumiHttp {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
static Future pgcReviewMod({
|
||||
required mediaId,
|
||||
required int score,
|
||||
required String content,
|
||||
required reviewId,
|
||||
}) async {
|
||||
var res = await Request().post(
|
||||
Api.pgcReviewMod,
|
||||
data: {
|
||||
'media_id': mediaId,
|
||||
'score': score,
|
||||
'content': content,
|
||||
'review_id': reviewId,
|
||||
'csrf': Accounts.main.csrf,
|
||||
},
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
static Future pgcReviewDel({
|
||||
required mediaId,
|
||||
required reviewId,
|
||||
}) async {
|
||||
var res = await Request().post(
|
||||
Api.pgcReviewDel,
|
||||
data: {
|
||||
'media_id': mediaId,
|
||||
'review_id': reviewId,
|
||||
'csrf': Accounts.main.csrf,
|
||||
},
|
||||
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