mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 11:06:51 +08:00
feat: setMsgDnd
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -831,4 +831,7 @@ class Api {
|
||||
static const String spaceOpus = '/x/polymer/web-dynamic/v1/opus/feed/space';
|
||||
|
||||
static const String articleList = '/x/article/list/web/articles';
|
||||
|
||||
static const String setMsgDnd =
|
||||
'${HttpString.tUrl}/link_setting/v1/link_setting/set_msg_dnd';
|
||||
}
|
||||
|
||||
@@ -581,4 +581,30 @@ class MsgHttp {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
static Future setMsgDnd({
|
||||
required uid,
|
||||
required int setting,
|
||||
required dndUid,
|
||||
}) async {
|
||||
final csrf = Accounts.main.csrf;
|
||||
var res = await Request().post(
|
||||
Api.setMsgDnd,
|
||||
data: {
|
||||
'uid': uid,
|
||||
'setting': setting,
|
||||
'dnd_uid': dndUid,
|
||||
'build': 0,
|
||||
'mobi_app': 'web',
|
||||
'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