feat:更新消息通知功能
This commit is contained in:
@@ -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: '',
|
||||
|
||||
Reference in New Issue
Block a user