feat:增加消息记录功能
This commit is contained in:
26
lib/models/chat_message.dart
Normal file
26
lib/models/chat_message.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'chat_message.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class ChatMessage {
|
||||
final int msgId;
|
||||
final int senderId;
|
||||
final String content;
|
||||
/// 消息类型(1文本 2图片 3语音)
|
||||
final int msgType;
|
||||
final DateTime createTime;
|
||||
|
||||
ChatMessage({
|
||||
required this.msgId,
|
||||
required this.senderId,
|
||||
required this.content,
|
||||
required this.msgType,
|
||||
required this.createTime,
|
||||
});
|
||||
|
||||
factory ChatMessage.fromJson(Map<String, dynamic> json) =>
|
||||
_$ChatMessageFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ChatMessageToJson(this);
|
||||
}
|
||||
Reference in New Issue
Block a user