mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
refactor(schemas): 统一 message/notification 命名边界,旧名收敛至兼容映射表
- notification 域:渠道能力(MessageChannel→NotificationChannel、ChannelCapability* 迁入 notification.py) - message 域:消息收发(Notification→Message、NotificationType→MessageType、CommingMessage→IncomingMessage、NotificationHistoryItem→MessageHistoryItem、NotificationClear*→MessageClear*) - Agent 工具契约:send_notification_message→send_message、notification_callback→message_callback - 源码不保留旧名物理别名,旧导入经 app/runtime/compat/manifest.py SYMBOL_ALIASES 惰性解析 - API 路径与持久化键冻结不变,前端零改动 - 新增兼容守护测试与 docs/rules/07 命名边界规范
This commit is contained in:
@@ -15,7 +15,7 @@ from app.modules.vocechat import VoceChatModule
|
||||
from app.modules.wechat import WechatModule
|
||||
from app.modules.wechat.wechatbot import WeChatBot
|
||||
from app.modules.wechatclawbot import WechatClawBotModule
|
||||
from app.schemas.types import MessageChannel
|
||||
from app.schemas.types import NotificationChannel
|
||||
|
||||
|
||||
def _parse_module_message(module, *, config: dict, body, client=None, form=None):
|
||||
@@ -52,19 +52,19 @@ def test_resolve_config_principal_ids_uses_nonempty_stable_values(config, expect
|
||||
("channel", "config", "principal_ids", "expected"),
|
||||
[
|
||||
(
|
||||
MessageChannel.Telegram,
|
||||
NotificationChannel.Telegram,
|
||||
{"TELEGRAM_ADMINS": "other", "TELEGRAM_CHAT_ID": "10001"},
|
||||
(10001,),
|
||||
True,
|
||||
),
|
||||
(
|
||||
MessageChannel.Feishu,
|
||||
NotificationChannel.Feishu,
|
||||
{"FEISHU_ADMINS": "other", "FEISHU_OPEN_ID": "ou_owner"},
|
||||
("ou_owner",),
|
||||
True,
|
||||
),
|
||||
(
|
||||
MessageChannel.Wechat,
|
||||
NotificationChannel.Wechat,
|
||||
{
|
||||
"WECHAT_MODE": "bot",
|
||||
"WECHAT_ADMINS": "other",
|
||||
@@ -74,7 +74,7 @@ def test_resolve_config_principal_ids_uses_nonempty_stable_values(config, expect
|
||||
True,
|
||||
),
|
||||
(
|
||||
MessageChannel.Wechat,
|
||||
NotificationChannel.Wechat,
|
||||
{
|
||||
"WECHAT_MODE": "app",
|
||||
"WECHAT_ADMINS": "other",
|
||||
@@ -84,7 +84,7 @@ def test_resolve_config_principal_ids_uses_nonempty_stable_values(config, expect
|
||||
False,
|
||||
),
|
||||
(
|
||||
MessageChannel.WechatClawBot,
|
||||
NotificationChannel.WechatClawBot,
|
||||
{
|
||||
"WECHATCLAWBOT_ADMINS": "other",
|
||||
"WECHATCLAWBOT_DEFAULT_TARGET": "wxid_owner",
|
||||
@@ -93,25 +93,25 @@ def test_resolve_config_principal_ids_uses_nonempty_stable_values(config, expect
|
||||
True,
|
||||
),
|
||||
(
|
||||
MessageChannel.QQ,
|
||||
NotificationChannel.QQ,
|
||||
{"QQBOT_ADMINS": "other", "QQ_OPENID": "qq_owner"},
|
||||
("qq_owner",),
|
||||
True,
|
||||
),
|
||||
(
|
||||
MessageChannel.Telegram,
|
||||
NotificationChannel.Telegram,
|
||||
{"TELEGRAM_ADMINS": "other", "TELEGRAM_CHAT_ID": "-10001"},
|
||||
(10001,),
|
||||
False,
|
||||
),
|
||||
(
|
||||
MessageChannel.Feishu,
|
||||
NotificationChannel.Feishu,
|
||||
{"FEISHU_ADMINS": "other", "FEISHU_CHAT_ID": "oc_group"},
|
||||
("ou_user",),
|
||||
False,
|
||||
),
|
||||
(
|
||||
MessageChannel.QQ,
|
||||
NotificationChannel.QQ,
|
||||
{"QQBOT_ADMINS": "other", "QQ_GROUP_OPENID": "qq_group"},
|
||||
("qq_member",),
|
||||
False,
|
||||
|
||||
Reference in New Issue
Block a user