feat:增加消息记录功能
This commit is contained in:
30
lib/models/chat_session.dart
Normal file
30
lib/models/chat_session.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'chat_session.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class ChatSession {
|
||||
final int conversationId;
|
||||
final int targetUserId;
|
||||
final String title;
|
||||
final String avatarUrl;
|
||||
final int msgType;
|
||||
final String lastMessageContent;
|
||||
final DateTime lastMessageTime;
|
||||
final int unreadCount;
|
||||
|
||||
ChatSession({
|
||||
required this.conversationId,
|
||||
required this.targetUserId,
|
||||
required this.title,
|
||||
required this.avatarUrl,
|
||||
required this.msgType,
|
||||
required this.lastMessageContent,
|
||||
required this.lastMessageTime,
|
||||
required this.unreadCount,
|
||||
});
|
||||
|
||||
factory ChatSession.fromJson(Map<String, dynamic> json) => _$ChatSessionFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ChatSessionToJson(this);
|
||||
}
|
||||
Reference in New Issue
Block a user