feat(player): 点赞与评论改为按集
This commit is contained in:
1 parent
e6f34977f5
commit
83822a0cbb
25 files changed
+337
-69
No files matched your search
@@ -95,6 +95,8 @@ Drama _drama(
|
||||
title: 'Episode ${index + 1}',
|
||||
isFree: true,
|
||||
videoUrl: 'https://example.test/$format-$index.mp4',
|
||||
likeCount: likeCount,
|
||||
commentCount: commentCount,
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -10,12 +10,14 @@ import 'package:fruitshorts/core/data/repositories/interaction_repository.dart';
|
||||
class CommentPageCall {
|
||||
const CommentPageCall({
|
||||
required this.dramaId,
|
||||
required this.episodeId,
|
||||
required this.rootId,
|
||||
required this.cursor,
|
||||
required this.size,
|
||||
});
|
||||
|
||||
final String dramaId;
|
||||
final String? episodeId;
|
||||
final String? rootId;
|
||||
final String? cursor;
|
||||
final int size;
|
||||
@@ -57,11 +59,13 @@ class FakeCommentRepository implements CommentRepository {
|
||||
final List<PublishCall> publishCalls = [];
|
||||
final List<String> deleteCalls = [];
|
||||
final List<String> countCalls = [];
|
||||
final List<String> countEpisodeCalls = [];
|
||||
int _pageIndex = 0;
|
||||
|
||||
@override
|
||||
Future<CommentPage> page({
|
||||
required String dramaId,
|
||||
String? episodeId,
|
||||
String? rootId,
|
||||
String? cursor,
|
||||
int size = commentPageSize,
|
||||
@@ -69,6 +73,7 @@ class FakeCommentRepository implements CommentRepository {
|
||||
pageCalls.add(
|
||||
CommentPageCall(
|
||||
dramaId: dramaId,
|
||||
episodeId: episodeId,
|
||||
rootId: rootId,
|
||||
cursor: cursor,
|
||||
size: size,
|
||||
@@ -81,8 +86,11 @@ class FakeCommentRepository implements CommentRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<int> count(String dramaId) async {
|
||||
Future<int> count(String dramaId, {String? episodeId}) async {
|
||||
countCalls.add(dramaId);
|
||||
if (episodeId != null && episodeId.isNotEmpty) {
|
||||
countEpisodeCalls.add(episodeId);
|
||||
}
|
||||
final error = countError;
|
||||
if (error != null) throw error;
|
||||
final result = countResult;
|
||||
|
||||
Reference in new issue
Block a user