blob: f4243b6ad6a1c478af357d90f2e1702accd6abfa [file] [log] [blame]
BirdNETMb0f71532025-05-26 17:37:33 +08001import { request } from '@umijs/max';
2import type { SysTorrentComment } from '@/pages/Torrent/Comments/data';
3
4/** 获取种子评论列表 */
5export async function listComments(torrentId: number) {
6 return request<SysTorrentComment[]>(`/api/system/torrent/comment/list`, {
7 method: 'get',
8 params: { torrentId },
9 });
10}
11
12/** 新增评论 */
13export async function addComment(data: {
14 torrentId: number;
15 userId: number;
16 content: string;
17 parentId?: number;
18}) {
19 return request(`/api/system/torrent/comment`, {
20 method: 'post',
21 data,
22 });
23}
24
25/** 删除评论 */
26export async function deleteComment(commentId: number) {
27 return request(`/api/system/torrent/comment/${commentId}`, {
28 method: 'delete',
29 });
30}