feat: 未读消息计数

This commit is contained in:
guozhigq
2024-06-15 20:34:28 +08:00
parent 46cef5e55b
commit bfdd996b08
4 changed files with 194 additions and 135 deletions

View File

@ -539,4 +539,7 @@ class Api {
/// 关闭会话
static const String removeSession =
'${HttpString.tUrl}/session_svr/v1/session_svr/remove_session';
/// 消息未读数
static const String unread = '${HttpString.tUrl}/x/im/web/msgfeed/unread';
}

View File

@ -225,4 +225,16 @@ class MsgHttp {
return {'status': false, 'date': [], 'msg': res.data['message']};
}
}
static Future unread() async {
var res = await Request().get(Api.unread);
if (res.data['code'] == 0) {
return {
'status': true,
'data': res.data['data'],
};
} else {
return {'status': false, 'date': [], 'msg': res.data['message']};
}
}
}