feat: msg: set notice

Closes #821

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-06 00:11:11 +08:00
parent 2d1697064d
commit a8fa4d72f3
5 changed files with 131 additions and 11 deletions

View File

@@ -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';
}

View File

@@ -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']};
}
}
}