feat(api): 添加热门卡片与榜单接口及实现

- 新增热门帖子、热门作者、榜单接口及实现
- 新增api-documentation,更好的ai协作
- 修复types没有导出的问题

BREAKING CHANGES: 1.0.0->1.1.0(latest)
This commit is contained in:
tobegold574
2025-11-18 22:29:40 +08:00
parent c3a8a525cb
commit a0c907beed
28 changed files with 1074 additions and 15 deletions

28
types/user/api.ts Normal file
View File

@@ -0,0 +1,28 @@
import type { User } from './base';
// 获取热门作者请求接口
export interface GetHotAuthorsRequest {
limit?: number; // 每页数量
days?: number; // 统计天数默认30天
}
// 获取热门作者响应接口
export interface GetHotAuthorsResponse {
data: User[]; // 数据列表
total: number; // 总数
}
// 获取作者榜单请求接口
export interface GetAuthorRankingRequest {
limit?: number; // 每页数量
period?: 'day' | 'week' | 'month'; // 统计周期
type?: 'posts' | 'views' | 'likes'; // 排序类型
}
// 获取作者榜单响应接口
export interface GetAuthorRankingResponse {
data: User[]; // 数据列表
total: number; // 总数
period: 'day' | 'week' | 'month'; // 统计周期
type: 'posts' | 'views' | 'likes'; // 排序类型
}

View File

@@ -2,3 +2,4 @@ export * from './base';
export * from './profile';
export * from './search';
export * from './enum';
export * from './api';