mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
refactor(api): 渠道与存储管理端点通用化,端点层零目标特色
- schemas 新增公共 ManageRequest(target+action+params) 与 StorageAction 词汇表
- endpoint 层收敛为 POST /notification/manage、/storage/manage 两个通用接口,
不再定义任何渠道/存储特定的名称、参数与响应字段,前端上送参数原样透传
- chain 层 manage_channel/manage_storage 接受字符串标识纯透明转发,
StorageChain 移除全部特色管理方法
- FileManagerModule 新增 storage_manage 统一入口,模块返回归一化为
{success, message, data};wechatclawbot channel_manage 同步归一化,
路由标识兼容枚举名/值/对象
- dashboard 与 agentopsassistant 的用量查询改走 manage_storage(usage)
- 新增 10 项存储契约守护测试,通知侧补充 3 项链透传与字符串路由测试,
API 守护测试对 ManageRequest 开放映射按设计豁免
This commit is contained in:
+13
-1
@@ -1,6 +1,6 @@
|
||||
"""API 端点共享的小型业务数据模型。"""
|
||||
|
||||
from typing import Optional, Union
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from pydantic import BaseModel, Field, RootModel
|
||||
from typing_extensions import TypeAliasType
|
||||
@@ -76,3 +76,15 @@ class TimeData(BaseModel):
|
||||
"""网络请求耗时。"""
|
||||
|
||||
time: int | float = Field(description="耗时毫秒数")
|
||||
|
||||
|
||||
class ManageRequest(BaseModel):
|
||||
"""通用管理请求:目标标识 + 管理动作 + 透传参数
|
||||
|
||||
用于通知渠道、网盘存储等统一管理能力入口,
|
||||
动作与参数的具体语义由目标模块自行解释
|
||||
"""
|
||||
|
||||
target: str = Field(description="管理目标标识,如渠道名或存储类型")
|
||||
action: str = Field(description="管理动作标识")
|
||||
params: Dict[str, Any] = Field(default_factory=dict, description="表单与动作参数,透传给目标模块")
|
||||
|
||||
Reference in New Issue
Block a user