Files
sweet_chat_app/lib/models/chat_message.dart
2026-06-19 21:10:03 +08:00

26 lines
609 B
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
}