forked from erp-dev/erp
fix: appversions
This commit is contained in:
@@ -8,6 +8,7 @@ from flower.common import ModelBase
|
||||
class NotifierChannelEnum(models.TextChoices):
|
||||
WECOM_WEBHOOK = "wecom_webhook", "企业微信机器人"
|
||||
MESSAGE_API = "message_api", "消息发送 API"
|
||||
JPUSH = "jpush", "极光推送"
|
||||
|
||||
|
||||
class NotificationEventKeyEnum(models.TextChoices):
|
||||
@@ -41,7 +42,7 @@ class Notifier(ModelBase):
|
||||
description = models.TextField(blank=True, null=True, verbose_name="备注描述")
|
||||
|
||||
def get_template_name(self) -> str:
|
||||
suffix = "json" if self.channel == NotifierChannelEnum.MESSAGE_API else "md"
|
||||
suffix = "json" if self.channel in {NotifierChannelEnum.MESSAGE_API, NotifierChannelEnum.JPUSH} else "md"
|
||||
return f"notifier/events/{self.template_key}.{suffix}"
|
||||
|
||||
def get_config_value(self, key: str, default=None):
|
||||
|
||||
Reference in New Issue
Block a user