🇨🇳 简体中文
🇺🇸 English
🇯🇵 日本語
Skip to the content.

其他 API

模块: others

本模块包含 19 个API端点。

📋 端点列表


📖 详细说明

🔍 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}

路径参数:

响应:


错误响应:


➕ Validate Channel Config

验证通道配置是否有效

Args: request: 包含通道配置列表的验证请求

Returns: ConfigValidationResponse: 验证结果,包含错误和警告信息

请求方式: POST /api/v1/channel-presets/validate

请求体:

// 参考模型: ConfigValidationRequest
- `channels` (array) - **必填** - 通道配置列表

响应:

// 参考模型: ConfigValidationResponse
- `valid` (boolean) - **必填** - 
- `errors` (array) - 可选 - 
- `warnings` (array) - 可选 - 

错误响应:


🔍 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/

查询参数:

响应:

// 数组: 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) - 可选 - 

错误响应:


➕ 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) - 可选 - 

错误响应:


🔍 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

查询参数:

响应:

// 数组: 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) - 可选 - 

错误响应:


➕ 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) - 可选 - 

错误响应:


🔍 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}

路径参数:

响应:

// 参考模型: 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) - 可选 - 

错误响应:


✏️ 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}

路径参数:

请求体:

// 参考模型: 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) - 可选 - 

错误响应:


🗑️ 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}

路径参数:

错误响应:


🔍 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}

路径参数:

响应:

// 参考模型: 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) - **必填** - 

错误响应: