mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: msg: set notice
Closes #821 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -805,4 +805,6 @@ class Api {
|
||||
|
||||
static const String liveSecondList =
|
||||
'${HttpString.liveBaseUrl}/xlive/app-interface/v2/second/getList';
|
||||
|
||||
static const String msgSetNotice = '/x/msgfeed/notice';
|
||||
}
|
||||
|
||||
@@ -566,4 +566,32 @@ class MsgHttp {
|
||||
static String getDevId() {
|
||||
return const Uuid().v4();
|
||||
}
|
||||
|
||||
static Future msgSetNotice({
|
||||
required dynamic id,
|
||||
required int noticeState,
|
||||
}) async {
|
||||
final csrf = Accounts.main.csrf;
|
||||
var res = await Request().post(
|
||||
Api.msgSetNotice,
|
||||
data: {
|
||||
'mobi_app': 'web',
|
||||
'platform': 'web',
|
||||
'tp': 0,
|
||||
'id': id,
|
||||
'notice_state': noticeState,
|
||||
'build': 0,
|
||||
'csrf_token': csrf,
|
||||
'csrf': 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