139 lines
3.8 KiB
Dart
139 lines
3.8 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'recommendation_model.dart';
|
|
|
|
// **************************************************************************
|
|
// TypeAdapterGenerator
|
|
// **************************************************************************
|
|
|
|
class RecommendationModelAdapter extends TypeAdapter<RecommendationModel> {
|
|
@override
|
|
final int typeId = 3;
|
|
|
|
@override
|
|
RecommendationModel read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return RecommendationModel(
|
|
id: fields[0] as String,
|
|
userId: fields[1] as String,
|
|
recommendations: (fields[2] as List).cast<MenuRecommendation>(),
|
|
originalMenuText: fields[3] as String,
|
|
menuImageUrl: fields[4] as String?,
|
|
menuImagePaths: (fields[12] as List?)?.cast<String>(),
|
|
prompt: fields[5] as String,
|
|
aiResponse: fields[6] as String,
|
|
confidence: fields[7] as double,
|
|
createdAt: fields[8] as DateTime,
|
|
isFavorite: fields[9] as bool,
|
|
sessionId: fields[10] as String,
|
|
selectedMenuName: fields[11] as String?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, RecommendationModel obj) {
|
|
writer
|
|
..writeByte(13)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.userId)
|
|
..writeByte(2)
|
|
..write(obj.recommendations)
|
|
..writeByte(3)
|
|
..write(obj.originalMenuText)
|
|
..writeByte(4)
|
|
..write(obj.menuImageUrl)
|
|
..writeByte(5)
|
|
..write(obj.prompt)
|
|
..writeByte(6)
|
|
..write(obj.aiResponse)
|
|
..writeByte(7)
|
|
..write(obj.confidence)
|
|
..writeByte(8)
|
|
..write(obj.createdAt)
|
|
..writeByte(9)
|
|
..write(obj.isFavorite)
|
|
..writeByte(10)
|
|
..write(obj.sessionId)
|
|
..writeByte(11)
|
|
..write(obj.selectedMenuName)
|
|
..writeByte(12)
|
|
..write(obj.menuImagePaths);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is RecommendationModelAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class MenuRecommendationAdapter extends TypeAdapter<MenuRecommendation> {
|
|
@override
|
|
final int typeId = 4;
|
|
|
|
@override
|
|
MenuRecommendation read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return MenuRecommendation(
|
|
menuName: fields[0] as String,
|
|
description: fields[1] as String,
|
|
price: fields[2] as double,
|
|
reason: fields[3] as String,
|
|
score: fields[4] as double,
|
|
tags: (fields[5] as List).cast<String>(),
|
|
category: fields[6] as String,
|
|
imageUrl: fields[7] as String?,
|
|
isRecommended: fields[8] as bool,
|
|
slotType: fields[9] as String?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, MenuRecommendation obj) {
|
|
writer
|
|
..writeByte(10)
|
|
..writeByte(0)
|
|
..write(obj.menuName)
|
|
..writeByte(1)
|
|
..write(obj.description)
|
|
..writeByte(2)
|
|
..write(obj.price)
|
|
..writeByte(3)
|
|
..write(obj.reason)
|
|
..writeByte(4)
|
|
..write(obj.score)
|
|
..writeByte(5)
|
|
..write(obj.tags)
|
|
..writeByte(6)
|
|
..write(obj.category)
|
|
..writeByte(7)
|
|
..write(obj.imageUrl)
|
|
..writeByte(8)
|
|
..write(obj.isRecommended)
|
|
..writeByte(9)
|
|
..write(obj.slotType);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is MenuRecommendationAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|