fix(player): 收藏与评论数实时刷新
This commit is contained in:
1 parent
97bbced02c
commit
5e2b8d9e4d
11 files changed
+275
-29
No files matched your search
@@ -1,6 +1,7 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import '../models/comment.dart';
|
||||
import '../models/json_numbers.dart';
|
||||
import 'api_client.dart';
|
||||
|
||||
/// 评论接口,对应契约 §1.7 的 `/app/comments*`。
|
||||
@@ -29,6 +30,15 @@ class CommentApi {
|
||||
return CommentPage.fromJson(data);
|
||||
}
|
||||
|
||||
/// 查询单部剧的有效评论总数;后端 Long 兼容数字与字符串。
|
||||
Future<int> count(String dramaId) async {
|
||||
final data = await _client.get(
|
||||
'/app/comments/count',
|
||||
query: {'dramaId': dramaId},
|
||||
);
|
||||
return jsonToInt(data);
|
||||
}
|
||||
|
||||
/// 发表评论或回复;回复只提交 `parentId`,不自行拼层级。
|
||||
Future<DramaComment> publish({
|
||||
required String dramaId,
|
||||
|
||||
Reference in new issue
Block a user