其他 API
模块: others
本模块包含 19 个API端点。
📋 端点列表
- 🔍
GET /- Root - 🔍
GET /health- Health Check - 🔍
GET /redis/status- Redis Status - 🔍
GET /redis/test- Redis Test - 🔍
GET /api/v1/me- Get Current User Info - ➕
POST /api/v1/logout- Logout - 🔍
GET /api/v1/channel-presets/presets- Get Presets - 🔍
GET /api/v1/channel-presets/presets/{preset_id}- Get Preset Detail - ➕
POST /api/v1/channel-presets/validate- Validate Channel Config - 🔍
GET /api/v1/custom-templates/- List Custom Templates - ➕
POST /api/v1/custom-templates/- Create Custom Template - 🔍
GET /api/v1/custom-templates- List Custom Templates - ➕
POST /api/v1/custom-templates- Create Custom Template - 🔍
GET /api/v1/custom-templates/{template_id}- Get Custom Template - ✏️
PUT /api/v1/custom-templates/{template_id}- Update Custom Template - 🗑️
DELETE /api/v1/custom-templates/{template_id}- Delete Custom Template - 🔍
GET /api/v1/indicators/- Get All Indicators - 🔍
GET /api/v1/indicators- Get All Indicators - 🔍
GET /api/v1/indicators/{indicator_id}- Get Indicator
📖 详细说明
🔍 Root
请求方式: GET /
响应:
🔍 Health Check
健康检查端点
请求方式: GET /health
响应:
🔍 Redis Status
Redis状态检查
请求方式: GET /redis/status
响应:
🔍 Redis Test
Redis测试端点
请求方式: GET /redis/test
响应:
🔍 Get Current User Info
获取当前用户信息
请求方式: GET /api/v1/me
响应:
➕ Logout
用户登出
请求方式: POST /api/v1/logout
响应:
🔍 Get Presets
获取所有预设模板列表
Returns: PresetListResponse: 包含所有可用预设模板的信息
请求方式: GET /api/v1/channel-presets/presets
响应:
// 参考模型: PresetListResponse
- `presets` (array) - **必填** -
- `total` (integer) - **必填** -
🔍 Get Preset Detail
获取预设模板详细配置(返回带注释的原始JSON)
Args: preset_id: 预设模板ID (aggressive-momentum, balanced-multi, conservative-value)
Returns: Response: 包含注释的原始JSON内容
请求方式: GET /api/v1/channel-presets/presets/{preset_id}
路径参数:
preset_id(string) - 必填 -
响应:
错误响应:
422: Validation Error
➕ Validate Channel Config
验证通道配置是否有效
Args: request: 包含通道配置列表的验证请求
Returns: ConfigValidationResponse: 验证结果,包含错误和警告信息
请求方式: POST /api/v1/channel-presets/validate
请求体:
// 参考模型: ConfigValidationRequest
- `channels` (array) - **必填** - 通道配置列表
响应:
// 参考模型: ConfigValidationResponse
- `valid` (boolean) - **必填** -
- `errors` (array) - 可选 -
- `warnings` (array) - 可选 -
错误响应:
422: Validation Error
🔍 List Custom Templates
List all custom templates for current user
Args: sort_by: Field to sort by (created_at or updated_at) order: Sort order (asc or desc) current_user: Current authenticated user repository: CustomTemplateRepository instance
Returns: List of custom templates
请求方式: GET /api/v1/custom-templates/
查询参数:
sort_by(string) - 可选 -order(string) - 可选 -
响应:
// 数组: CustomTemplateResponse[]
- `id` (string) - **必填** -
- `user_id` (string) - **必填** -
- `template_name` (string) - **必填** -
- `description` (object) - **必填** -
- `channels_config` (array) - **必填** -
- `created_at` (string) - **必填** -
- `updated_at` (string) - **必填** -
- `version` (integer) - 可选 -
- `parent_id` (object) - 可选 -
- `is_default` (boolean) - 可选 -
- `tags` (object) - 可选 -
错误响应:
422: Validation Error
➕ Create Custom Template
Create new custom template
Args: template_data: Template creation data current_user: Current authenticated user repository: CustomTemplateRepository instance
Returns: Created template
Raises: 400: Template name already exists
请求方式: POST /api/v1/custom-templates/
请求体:
// 参考模型: CustomTemplateCreate
- `template_name` (string) - **必填** -
- `description` (object) - 可选 -
- `channels_config` (array) - **必填** -
- `tags` (object) - 可选 -
- `is_default` (boolean) - 可选 -
响应:
// 参考模型: CustomTemplateResponse
- `id` (string) - **必填** -
- `user_id` (string) - **必填** -
- `template_name` (string) - **必填** -
- `description` (object) - **必填** -
- `channels_config` (array) - **必填** -
- `created_at` (string) - **必填** -
- `updated_at` (string) - **必填** -
- `version` (integer) - 可选 -
- `parent_id` (object) - 可选 -
- `is_default` (boolean) - 可选 -
- `tags` (object) - 可选 -
错误响应:
422: Validation Error
🔍 List Custom Templates
List all custom templates for current user
Args: sort_by: Field to sort by (created_at or updated_at) order: Sort order (asc or desc) current_user: Current authenticated user repository: CustomTemplateRepository instance
Returns: List of custom templates
请求方式: GET /api/v1/custom-templates
查询参数:
sort_by(string) - 可选 -order(string) - 可选 -
响应:
// 数组: CustomTemplateResponse[]
- `id` (string) - **必填** -
- `user_id` (string) - **必填** -
- `template_name` (string) - **必填** -
- `description` (object) - **必填** -
- `channels_config` (array) - **必填** -
- `created_at` (string) - **必填** -
- `updated_at` (string) - **必填** -
- `version` (integer) - 可选 -
- `parent_id` (object) - 可选 -
- `is_default` (boolean) - 可选 -
- `tags` (object) - 可选 -
错误响应:
422: Validation Error
➕ Create Custom Template
Create new custom template
Args: template_data: Template creation data current_user: Current authenticated user repository: CustomTemplateRepository instance
Returns: Created template
Raises: 400: Template name already exists
请求方式: POST /api/v1/custom-templates
请求体:
// 参考模型: CustomTemplateCreate
- `template_name` (string) - **必填** -
- `description` (object) - 可选 -
- `channels_config` (array) - **必填** -
- `tags` (object) - 可选 -
- `is_default` (boolean) - 可选 -
响应:
// 参考模型: CustomTemplateResponse
- `id` (string) - **必填** -
- `user_id` (string) - **必填** -
- `template_name` (string) - **必填** -
- `description` (object) - **必填** -
- `channels_config` (array) - **必填** -
- `created_at` (string) - **必填** -
- `updated_at` (string) - **必填** -
- `version` (integer) - 可选 -
- `parent_id` (object) - 可选 -
- `is_default` (boolean) - 可选 -
- `tags` (object) - 可选 -
错误响应:
422: Validation Error
🔍 Get Custom Template
Get single custom template by ID
Args: template_id: Template UUID current_user: Current authenticated user repository: CustomTemplateRepository instance
Returns: Custom template details
Raises: 404: Template not found
请求方式: GET /api/v1/custom-templates/{template_id}
路径参数:
template_id(string) - 必填 -
响应:
// 参考模型: CustomTemplateResponse
- `id` (string) - **必填** -
- `user_id` (string) - **必填** -
- `template_name` (string) - **必填** -
- `description` (object) - **必填** -
- `channels_config` (array) - **必填** -
- `created_at` (string) - **必填** -
- `updated_at` (string) - **必填** -
- `version` (integer) - 可选 -
- `parent_id` (object) - 可选 -
- `is_default` (boolean) - 可选 -
- `tags` (object) - 可选 -
错误响应:
422: Validation Error
✏️ Update Custom Template
Update existing custom template
Args: template_id: Template UUID template_data: Template update data current_user: Current authenticated user repository: CustomTemplateRepository instance
Returns: Updated template
Raises: 400: New template name already exists 404: Template not found
请求方式: PUT /api/v1/custom-templates/{template_id}
路径参数:
template_id(string) - 必填 -
请求体:
// 参考模型: CustomTemplateUpdate
- `template_name` (object) - 可选 -
- `description` (object) - 可选 -
- `channels_config` (object) - 可选 -
- `tags` (object) - 可选 -
- `create_new_version` (boolean) - 可选 -
响应:
// 参考模型: CustomTemplateResponse
- `id` (string) - **必填** -
- `user_id` (string) - **必填** -
- `template_name` (string) - **必填** -
- `description` (object) - **必填** -
- `channels_config` (array) - **必填** -
- `created_at` (string) - **必填** -
- `updated_at` (string) - **必填** -
- `version` (integer) - 可选 -
- `parent_id` (object) - 可选 -
- `is_default` (boolean) - 可选 -
- `tags` (object) - 可选 -
错误响应:
422: Validation Error
🗑️ Delete Custom Template
Delete custom template (删除指定版本)
如果是最后一个版本,则删除整个策略。
Args: template_id: Template UUID current_user: Current authenticated user repository: CustomTemplateRepository instance
Raises: 404: Template not found
请求方式: DELETE /api/v1/custom-templates/{template_id}
路径参数:
template_id(string) - 必填 -
错误响应:
204: Successful Response422: Validation Error
🔍 Get All Indicators
获取所有技术指标元数据列表
Returns: 所有指标的元数据列表
请求方式: GET /api/v1/indicators/
响应:
// 数组: IndicatorMetadata[]
- `id` (string) - **必填** -
- `name_cn` (string) - **必填** -
- `name_en` (string) - **必填** -
- `category` (string) - **必填** -
- `description` (object) - **必填** -
- 类型: `IndicatorDescription`
- `parameters` (array) - **必填** -
- `outputs` (array) - **必填** -
- `pandas_ta` (object) - 可选 -
- `usage_notes` (object) - 可选 -
- `related_indicators` (object) - 可选 -
- `version` (string) - **必填** -
🔍 Get All Indicators
获取所有技术指标元数据列表
Returns: 所有指标的元数据列表
请求方式: GET /api/v1/indicators
响应:
// 数组: IndicatorMetadata[]
- `id` (string) - **必填** -
- `name_cn` (string) - **必填** -
- `name_en` (string) - **必填** -
- `category` (string) - **必填** -
- `description` (object) - **必填** -
- 类型: `IndicatorDescription`
- `parameters` (array) - **必填** -
- `outputs` (array) - **必填** -
- `pandas_ta` (object) - 可选 -
- `usage_notes` (object) - 可选 -
- `related_indicators` (object) - 可选 -
- `version` (string) - **必填** -
🔍 Get Indicator
获取单个技术指标详情
Args: indicator_id: 指标 ID(如 rsi, macd, bollinger_bands)
Returns: 指标详细信息
Raises: 404: 指标不存在
请求方式: GET /api/v1/indicators/{indicator_id}
路径参数:
indicator_id(string) - 必填 -
响应:
// 参考模型: IndicatorMetadata
- `id` (string) - **必填** -
- `name_cn` (string) - **必填** -
- `name_en` (string) - **必填** -
- `category` (string) - **必填** -
- `description` (object) - **必填** -
- 类型: `IndicatorDescription`
- `parameters` (array) - **必填** -
- `outputs` (array) - **必填** -
- `pandas_ta` (object) - 可选 -
- `usage_notes` (object) - 可选 -
- `related_indicators` (object) - 可选 -
- `version` (string) - **必填** -
错误响应:
422: Validation Error