Files
customer-im-client-dev/apps/im_app/lib/domain/entities/message.dart
2026-03-07 18:15:05 +08:00

76 lines
1.7 KiB
Dart

/// 消息 Domain 实体
class Message {
final int id;
final int? messageId;
final int? chatId;
final int? chatIdx;
final int? sendId;
final String? content;
final int? typ;
final int? sendTime;
final int? expireTime;
final int? createTime;
final String? atUsers;
final String emojis;
final int editTime;
final int refTyp;
final int flag;
final String cmid;
const Message({
required this.id,
this.messageId,
this.chatId,
this.chatIdx,
this.sendId,
this.content,
this.typ,
this.sendTime,
this.expireTime,
this.createTime,
this.atUsers,
this.emojis = '[]',
this.editTime = 0,
this.refTyp = 0,
this.flag = 0,
this.cmid = '',
});
Message copyWith({
int? id,
int? messageId,
int? chatId,
int? chatIdx,
int? sendId,
String? content,
int? typ,
int? sendTime,
int? expireTime,
int? createTime,
String? atUsers,
String? emojis,
int? editTime,
int? refTyp,
int? flag,
String? cmid,
}) {
return Message(
id: id ?? this.id,
messageId: messageId ?? this.messageId,
chatId: chatId ?? this.chatId,
chatIdx: chatIdx ?? this.chatIdx,
sendId: sendId ?? this.sendId,
content: content ?? this.content,
typ: typ ?? this.typ,
sendTime: sendTime ?? this.sendTime,
expireTime: expireTime ?? this.expireTime,
createTime: createTime ?? this.createTime,
atUsers: atUsers ?? this.atUsers,
emojis: emojis ?? this.emojis,
editTime: editTime ?? this.editTime,
refTyp: refTyp ?? this.refTyp,
flag: flag ?? this.flag,
cmid: cmid ?? this.cmid,
);
}
}