feat(reset): 以构造器模式重构

- 加了大文件传输自定义分片协议

BREAKING CHANGES: 0.1.0(latest)
This commit is contained in:
tobegold574
2025-11-30 20:27:53 +08:00
parent c5853847ae
commit 382e3aff21
82 changed files with 1421 additions and 7010 deletions

View File

@@ -1,19 +1,44 @@
// 导出API工厂函数和默认实例
export { createApi, api } from './factory';
// 导出公共接口和常量
export { API_ENDPOINTS } from './common';
export type { ApiError } from './common';
// 导出API类型和配置
export {
API_ENDPOINTS,
ApiStatusCode,
ApiErrorType,
DEFAULT_REQUEST_CONFIG,
DEFAULT_PAGINATION_CONFIG,
type ApiClient,
type ApiResponse,
type PaginatedResponse,
type ErrorResponse
} from './types';
// 导出帖子相关API
export { PostApiService } from './post-api';
// 向后兼容的导出
export { apiClient } from './client';
export { postApi, userApi, chatApi, modelApi } from './modules';
// 导出聊天相关API
export { ChatApiService } from './chat-api';
// 导出模型相关API
export { ModelApiService } from './model-api';
// 导出用户相关API
export { UserApiService } from './user-api';
// 导出上传相关API
export { UploadApiService } from './upload-api';
/**
* API模块入口
*
* 本模块提供了所有业务相关的API服务包括
* - 帖子相关:创建、查询、点赞、收藏等操作
* - 聊天相关:会话管理、消息发送与接收
* - 模型相关:模型查询、评论、点赞等
* - 用户相关:登录、注册、个人资料管理
*
* 所有API服务都使用装饰器模式实现通过ApiClientBound装饰器注入HTTP客户端实例
* 使用HTTP方法装饰器GET、POST等定义请求方法和路径
* 通过Request装饰器自动处理请求逻辑。
*/
import { postApi } from './post-api';
import { chatApi } from './chat-api';
import { modelApi } from './model-api';
import { userApi } from './user-api';
import { uploadApi } from './upload-api';
export const api = {
post: postApi,
chat: chatApi,
model: modelApi,
user: userApi,
upload: uploadApi,
};