feat:更新消息通知功能

This commit is contained in:
2026-06-20 16:11:57 +08:00
parent 5d12377606
commit 5e0864d3ac
16 changed files with 332 additions and 24 deletions

View File

@@ -15,12 +15,14 @@ enum ImMessageType {
class ImMessage {
final ImMessageType type;
final String title;
final String from;
final String to;
final String content;
ImMessage({
required this.type,
required this.title,
required this.from,
required this.to,
required this.content,
@@ -33,6 +35,7 @@ class ImMessage {
factory ImMessage.fromJson(Map<String, dynamic> json) {
return ImMessage(
type: ImMessageType.values.firstWhere((e) => e.value == json['type']),
title: json['title'],
from: json['from'],
to: json['to'],
content: json['content'],
@@ -41,6 +44,7 @@ class ImMessage {
Map<String, dynamic> toJson() => {
'type': type.value,
'title': title,
'from': from,
'to': to,
'content': content,
@@ -53,6 +57,7 @@ class ImMessage {
static ImMessage online(int userId) {
return ImMessage(
type: ImMessageType.online,
title: '',
from: userId.toString(),
to: 'SYSTEM',
content: '',