1
0
forked from erp-dev/erp

feat: message-api for mission via wecomm agent

This commit is contained in:
2026-05-14 09:30:38 +08:00
parent 9359013b4c
commit f409f2e6ee
38 changed files with 2085 additions and 49 deletions

View File

@@ -7,6 +7,7 @@ from flower.common import ModelBase
class NotifierChannelEnum(models.TextChoices):
WECOM_WEBHOOK = "wecom_webhook", "企业微信机器人"
MESSAGE_API = "message_api", "消息发送 API"
class NotificationEventKeyEnum(models.TextChoices):
@@ -40,7 +41,8 @@ class Notifier(ModelBase):
description = models.TextField(blank=True, null=True, verbose_name="备注描述")
def get_template_name(self) -> str:
return f"notifier/events/{self.template_key}.md"
suffix = "json" if self.channel == NotifierChannelEnum.MESSAGE_API else "md"
return f"notifier/events/{self.template_key}.{suffix}"
def get_config_value(self, key: str, default=None):
config = self.config or {}