30 lines
771 B
Dart
30 lines
771 B
Dart
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);
|
|
} |