1
0
forked from erp-dev/erp

fix: appversions

This commit is contained in:
2026-07-11 00:05:05 +08:00
parent 48e4782e1e
commit e91d06e4b6
26 changed files with 2582 additions and 19 deletions

View File

@@ -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):