mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-30 04:27:40 +08:00
- 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 开放映射按设计豁免
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
from typing import Any, Dict
|
|
|
|
from app.chain import ChainBase
|
|
|
|
|
|
class NotificationChain(ChainBase):
|
|
"""
|
|
通知渠道管理链,仅按渠道名透明转发管理动作到模块
|
|
|
|
不包含任何渠道特定逻辑:渠道标识、动作语义、表单参数解释、客户端实例
|
|
解析与临时参数初始化全部封闭在实现 channel_manage 契约的模块内部
|
|
"""
|
|
|
|
def manage_channel(
|
|
self,
|
|
channel: str,
|
|
action: str,
|
|
**params: Any,
|
|
) -> Dict[str, Any]:
|
|
"""
|
|
对指定通知渠道执行管理动作
|
|
|
|
:param channel: 渠道标识,用于模块路由
|
|
:param action: 通用管理动作标识,具体语义由渠道模块解释
|
|
:param params: 表单与动作参数,原样透传给模块
|
|
:return: 统一结构 {"success": bool, "message": ..., ...}
|
|
"""
|
|
result = self.run_module("channel_manage", channel=channel, action=action, **params)
|
|
return result or {"success": False, "message": "该通知渠道未启用或不支持此管理动作"}
|