fix: pk comment

This commit is contained in:
zzc
2026-06-15 19:59:07 +08:00
parent f256df8f94
commit 3c7e520062
4 changed files with 954 additions and 4 deletions

View File

@@ -19,3 +19,57 @@ export const vote = async (data) => {
data,
});
};
/**
* 获取PK 评论列表
* @param { pkId: string, page: number, orderBy: string }
* @param { orderBy: string } 排序字段,可选值:'hot' | 'new',
*/
export const fetchCommentList = async (data) => {
return request({
url: "/api/rating/pk/comment/list",
method: "GET",
data,
});
};
/**
* 获取PK 评论回复
* @param { pkId: string, rootCommentId: string, page: number }
*/
export const fetchCommentReplyList = async (data) => {
return request({
url: "/api/rating/pk/comment/replies",
method: "GET",
data,
});
};
/**
* 发布PK 评论
* @param { pkId: string, content: string, parentCommentId?: string, replyToCommentId?: string }
* @param { parentCommentId?: string } 父评论ID回复时必填
* @param { replyToCommentId?: string } 回复的评论ID回复时必填
*/
export const publishComment = async (data) => {
return request({
url: "/api/rating/pk/comment",
method: "POST",
data,
});
};
/**
* PK 评论 点赞
* @param { commentId: string }
*/
export const likeComment = async (data) => {
return request({
url: "/api/rating/pk/comment/like",
method: "POST",
data,
});
};