feat(flutter): 接入分类记录收藏与下载授权

This commit is contained in:
Zhou Weidong committed 2026-10-17 14:49:16 +08:00
1 parent 00280ca0da
commit cc4d7c5a9d
52 files changed
+4440 -171

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
// Author: fruit.com.cn
import 'package:fruitshorts/core/data/models/content_category.dart';
import 'package:fruitshorts/core/data/models/home_feed.dart';
import 'package:fruitshorts/core/data/repositories/catalog_repository.dart';
import 'package:fruitshorts/core/data/repositories/category_repository.dart';
/// 分类测试仓库:分类清单固定,发现 feed 复用注入的目录仓库。
class FakeCategoryRepository implements CategoryRepository {
FakeCategoryRepository({
required this.catalog,
this.categories = const [ContentCategory(id: '7', name: 'Romance')],
});
final CatalogRepository catalog;
final List<ContentCategory> categories;
@override
Future<List<ContentCategory>> fetchCategories() async => categories;
@override
Future<HomeFeed> fetchDiscoverFeed() => catalog.fetchDiscoverFeed();
}
+6
View File
@@ -64,4 +64,10 @@ class FakeWatchHistory implements WatchHistoryRepository {
@override
Future<void> remove(String dramaId) async => records.remove(dramaId);
@override
Future<void> clear() async {
records.clear();
recentRecords = const [];
}
}