feat(message): 实现自定义消息模板功能

- 新增 MessageTemplateHelper 类用于渲染消息模板
- 在 ChainBase 中集成消息模板渲染功能
- 修改 DownloadChain、SubscribeChain 和 TransferChain 以使用新消息模板
- 新增 TemplateHelper 类用于处理模板格式
- 在 SystemConfigKey 中添加 NotificationTemplates 配置项
- 更新 Notification 模型以支持 ctype 字段
This commit is contained in:
Attente
2025-05-05 05:27:48 +08:00
parent 52ce6ff38e
commit 20c1f30877
9 changed files with 547 additions and 197 deletions
+3 -1
View File
@@ -2,7 +2,7 @@ from typing import Optional, Union
from pydantic import BaseModel, Field
from app.schemas.types import NotificationType, MessageChannel
from app.schemas.types import ContentType, NotificationType, MessageChannel
class CommingMessage(BaseModel):
@@ -45,6 +45,8 @@ class Notification(BaseModel):
source: Optional[str] = None
# 消息类型
mtype: Optional[NotificationType] = None
# 内容类型
ctype: Optional[ContentType] = None
# 标题
title: Optional[str] = None
# 文本内容