diff --git a/src/services/mockSocketService.js b/src/services/mockSocketService.js index a78faa23..9e69bc94 100644 --- a/src/services/mockSocketService.js +++ b/src/services/mockSocketService.js @@ -683,14 +683,23 @@ class MockSocketService { * @param {object} customData - 自定义消息数据(可选) */ sendTestNotification(customData = null) { - const notification = customData || { - type: 'trade_alert', - severity: 'info', - title: '测试消息', - message: '这是一条手动触发的测试消息', - timestamp: Date.now(), - autoClose: 5000, + // 如果传入自定义数据,直接使用(向后兼容) + if (customData) { + this.emit('new_event', customData); + logger.info('mockSocketService', 'Custom test notification sent', customData); + return; + } + + // 默认发送新格式的测试通知(符合当前通知系统规范) + const notification = { + type: 'announcement', // 公告通知类型 + priority: 'important', // 重要优先级(30秒自动关闭) + title: '🧪 测试通知', + content: '这是一条手动触发的测试消息,用于验证通知系统是否正常工作', + publishTime: Date.now(), + pushTime: Date.now(), id: `test_${Date.now()}`, + clickable: false, }; this.emit('new_event', notification);