fix: pk comment
This commit is contained in:
54
api/pk.js
54
api/pk.js
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user