fix: 重命名通知渠道模型避免与 alert 模块冲突
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
- NotificationChannel -> TaskNotifyChannel - platform_notification_channels -> platform_task_notify_channels
This commit is contained in:
@@ -10,7 +10,7 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from ..database import SessionLocal
|
||||
from ..models.scheduled_task import ScheduledTask, TaskLog
|
||||
from ..models.notification_channel import NotificationChannel
|
||||
from ..models.notification_channel import TaskNotifyChannel
|
||||
from .script_executor import ScriptExecutor
|
||||
|
||||
|
||||
@@ -260,9 +260,9 @@ class SchedulerService:
|
||||
# 发送到通知渠道
|
||||
for channel_id in channel_ids:
|
||||
try:
|
||||
channel = db.query(NotificationChannel).filter(
|
||||
NotificationChannel.id == channel_id,
|
||||
NotificationChannel.is_enabled == True
|
||||
channel = db.query(TaskNotifyChannel).filter(
|
||||
TaskNotifyChannel.id == channel_id,
|
||||
TaskNotifyChannel.is_enabled == True
|
||||
).first()
|
||||
|
||||
if not channel:
|
||||
@@ -280,7 +280,7 @@ class SchedulerService:
|
||||
except Exception as e:
|
||||
print(f"发送企微应用消息失败: {e}")
|
||||
|
||||
async def _send_to_channel(self, channel: NotificationChannel, content: str, title: str):
|
||||
async def _send_to_channel(self, channel: TaskNotifyChannel, content: str, title: str):
|
||||
"""发送消息到通知渠道"""
|
||||
if channel.channel_type == 'dingtalk_bot':
|
||||
payload = {
|
||||
|
||||
Reference in New Issue
Block a user