| 12345678910111213141516171819202122232425262728293031 |
- import 'package:json_annotation/json_annotation.dart';
- part 'chat_item.g.dart';
- @JsonSerializable()
- class ChatItem {
- @JsonKey(name: "id")
- final int id;
- @JsonKey(name: "chatId")
- final String conversationId;
- @JsonKey(name: "role")
- final String role;
- @JsonKey(name: "content")
- String content;
- @JsonKey(name: "createTime")
- final String createTime;
- ChatItem({
- required this.id,
- required this.conversationId,
- required this.role,
- required this.content,
- required this.createTime,
- });
- factory ChatItem.fromJson(Map<String, dynamic> json) => _$ChatItemFromJson(json);
- }
|