blob: 1ea221a380f9c6ee81e7b3a15a785ae75892329c [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) {
BirdNETMed9f2f92025-05-26 20:12:30 +08006 return request<SysTorrentComment[]>(`/api/system/torrent/comment/${torrentId}`, {
BirdNETMb0f71532025-05-26 17:37:33 +08007 method: 'get',
BirdNETMb0f71532025-05-26 17:37:33 +08008 });
9}
10
11/** 新增评论 */
12export async function addComment(data: {
13 torrentId: number;
14 userId: number;
15 content: string;
16 parentId?: number;
17}) {
18 return request(`/api/system/torrent/comment`, {
19 method: 'post',
20 data,
21 });
22}
23
24/** 删除评论 */
25export async function deleteComment(commentId: number) {
26 return request(`/api/system/torrent/comment/${commentId}`, {
27 method: 'delete',
28 });
29}