feat(api): 添加热门卡片与榜单接口及实现
- 新增热门帖子、热门作者、榜单接口及实现 - 新增api-documentation,更好的ai协作 - 修复types没有导出的问题 BREAKING CHANGES: 1.0.0->1.1.0(latest)
This commit is contained in:
@@ -16,7 +16,11 @@ import type {
|
||||
GetCommentsRequest,
|
||||
GetCommentsResponse,
|
||||
LikeCommentRequest,
|
||||
LikeCommentResponse
|
||||
LikeCommentResponse,
|
||||
GetHotPostsRequest,
|
||||
GetHotPostsResponse,
|
||||
GetPostRankingRequest,
|
||||
GetPostRankingResponse
|
||||
} from '@/types/post/api';
|
||||
|
||||
// 帖子API服务工厂函数
|
||||
@@ -61,5 +65,15 @@ export const postApi = (client: ApiClient) => ({
|
||||
// 点赞评论
|
||||
likeComment: ({ commentId }: LikeCommentRequest): Promise<LikeCommentResponse> => {
|
||||
return client.put(`/comments/${commentId}/like`);
|
||||
},
|
||||
|
||||
// 获取热门帖子
|
||||
getHotPosts: (params: GetHotPostsRequest = {}): Promise<GetHotPostsResponse> => {
|
||||
return client.get('/posts/hot', { params });
|
||||
},
|
||||
|
||||
// 获取帖子榜单
|
||||
getPostRanking: (params: GetPostRankingRequest = {}): Promise<GetPostRankingResponse> => {
|
||||
return client.get('/posts/ranking', { params });
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user