Commit Graph

2 Commits

Author SHA1 Message Date
禹仔二号
f7903f8e9b webhook添加了sendto发送对象,修复了webhook通知ui显示错误问题,修复了websocket服务端错误关闭链接问题 (#1300)
* 新增图片作为email附件发送功能

* feat(notification): 为 WebhookNotifier 添加 send_to 功能

- 在 WebhookNotifier 类中添加 send_to 属性
- 修改 TransformData 方法,增加 send_to 字段
- 在 NotificationConfig 中添加 webhook_endpoint 和 websocket_endpoint 属性

* refactor(WebhookNotifier): 添加 send_to 属性并调整访问修饰符

* refactor(notification): 重构 WebhookNotifier 并更新 NotificationConfig

- 在 NotificationConfig 中添加 WebhookSendTo 属性
- 重构 WebhookNotifier 构造函数,使用 NotificationConfig 对象进行初始化
- 更新 WebhookNotifier 发送逻辑,使用新的配置属性

* feat: add webhook ui.

* refactor(WebhookNotifier): 重构 TransformData 方法以优化数据结构- 将 notification_data 的内容合并到外层字典,以便于 webhook 接收端获取数据- 新增 event、result、timestamp 等字段,使数据结构

* fix(WebSocketNotifier): 添加消息发送后关闭连接的功能

- 在 SendAsync 方法中添加了 CloseAsync() 调用,确保消息发送后关闭 WebSocket 连接
- 此修改解决了消息发送后未关闭连接的问题,提高了资源利用率和系统稳定性

* fix: implement unified webhook ui

* fix: typos.

---------

Co-authored-by: DR-lin-eng <@DR-lin-eng>
Co-authored-by: 秋云 <physligl@gmail.com>
2025-03-15 10:33:33 +08:00
禹仔二号
6becb9dd5a 添加websocket和smtp通知方法,添加bark通知,websocket为qq机器人预留。 (#1254)
* feat: add email and websocket notification

* fix typos.

* refactor(notifiers): 重构邮件和 WebSocket 通知器

- 提升 EmailNotifier 中的 SmtpClient 为类的成员变量,并在构造函数中初始化,优化资源使用
- 改进 WebSocketNotifier 的连接和重连逻辑,提高稳定性
- 优化通知器的错误处理和日志记录,增强可维护性

* Create BarkNotifier.cs

* Update NotificationConfig.cs

* Update NotificationService.cs

* Update CommonSettingsPageViewModel.cs

* Add files via upload

* Add files via upload

* Add files via upload

* Update CommonSettingsPage.xaml

* Delete BetterGenshinImpact/Service/Notifier/BarkNotifier.cs

* Add files via upload

* Update BarkNotifier.cs

* Update NotificationService.cs

* Update CommonSettingsPageViewModel.cs

* Update CommonSettingsPage.xaml

* Delete BetterGenshinImpact/Service/BarkNotifier.cs

* Add files via upload

* Add files via upload

* Add files via upload

* Update CommonSettingsPage.xaml

* fix: 回退部分代码,修复了程序崩溃的错误

* fix: remove api.day.app

---------

Co-authored-by: 秋云 <physligl@gmail.com>
Co-authored-by: DR-lin-eng <52230594+DR-lin-eng@users.noreply.github.com>
2025-03-13 00:06:09 +08:00