1
0
forked from erp-dev/erp

feat: notifier beta

This commit is contained in:
2026-04-13 12:30:33 +08:00
parent 646dbe7f18
commit 9512132bb9
50 changed files with 17830 additions and 2 deletions

15
notifier/registry.py Normal file
View File

@@ -0,0 +1,15 @@
from notifier.backends import WeComWebhookNotifierBackend
from notifier.models import NotifierChannelEnum
BACKEND_REGISTRY = {
NotifierChannelEnum.WECOM_WEBHOOK: WeComWebhookNotifierBackend,
}
def get_notifier_backend(channel: str):
try:
backend_cls = BACKEND_REGISTRY[channel]
except KeyError as exc:
raise ValueError(f"不支持的通知渠道: {channel}") from exc
return backend_cls()