📊 数据持久化阶段完成: - 完成4个数据模型的Hive集成(Book, Bookshelf, Bookmark, Highlight) - 实现4个Repository数据访问层 - 生成5个TypeAdapter自动序列化文件 - 完成所有模型的CRUD操作和测试验证 📚 项目文档更新: - 新增数据持久化阶段完成总结文档 - 更新CLAUDE.md项目主文档 - 完善项目结构说明和开发进度 🚀 UI开发阶段规划: - 定义产品定位:类似微信读书的Material Design电子书阅读器 - 制定4阶段开发计划:UI基础架构→顶部导航→首页内容→数据集成 - 明确页面结构:底部Tab导航(首页/书库/统计/我的) - 规划核心功能:搜索、导入、最近阅读、摘录列表 🎯 下一里程碑: - 开始UI基础架构搭建 - 实现底部Tab导航和Material Design主题系统 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
108 lines
2.6 KiB
Dart
108 lines
2.6 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'bookshelf.dart';
|
|
|
|
// **************************************************************************
|
|
// TypeAdapterGenerator
|
|
// **************************************************************************
|
|
|
|
class BookshelfAdapter extends TypeAdapter<Bookshelf> {
|
|
@override
|
|
final int typeId = 4;
|
|
|
|
@override
|
|
Bookshelf read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return Bookshelf(
|
|
id: fields[0] as String,
|
|
name: fields[1] as String,
|
|
description: fields[2] as String?,
|
|
coverImagePath: fields[3] as String?,
|
|
createdTime: fields[4] as DateTime,
|
|
lastModifiedTime: fields[5] as DateTime,
|
|
bookCount: fields[6] as int,
|
|
type: fields[7] as BookshelfType,
|
|
isDefault: fields[8] as bool,
|
|
sortOrder: fields[9] as int,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, Bookshelf obj) {
|
|
writer
|
|
..writeByte(10)
|
|
..writeByte(0)
|
|
..write(obj.id)
|
|
..writeByte(1)
|
|
..write(obj.name)
|
|
..writeByte(2)
|
|
..write(obj.description)
|
|
..writeByte(3)
|
|
..write(obj.coverImagePath)
|
|
..writeByte(4)
|
|
..write(obj.createdTime)
|
|
..writeByte(5)
|
|
..write(obj.lastModifiedTime)
|
|
..writeByte(6)
|
|
..write(obj.bookCount)
|
|
..writeByte(7)
|
|
..write(obj.type)
|
|
..writeByte(8)
|
|
..write(obj.isDefault)
|
|
..writeByte(9)
|
|
..write(obj.sortOrder);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is BookshelfAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|
|
|
|
class BookshelfTypeAdapter extends TypeAdapter<BookshelfType> {
|
|
@override
|
|
final int typeId = 3;
|
|
|
|
@override
|
|
BookshelfType read(BinaryReader reader) {
|
|
switch (reader.readByte()) {
|
|
case 0:
|
|
return BookshelfType.system;
|
|
case 1:
|
|
return BookshelfType.custom;
|
|
default:
|
|
return BookshelfType.system;
|
|
}
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, BookshelfType obj) {
|
|
switch (obj) {
|
|
case BookshelfType.system:
|
|
writer.writeByte(0);
|
|
break;
|
|
case BookshelfType.custom:
|
|
writer.writeByte(1);
|
|
break;
|
|
}
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is BookshelfTypeAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|