forked from erp-dev/erp
feat: message-api for mission via wecomm agent
This commit is contained in:
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user