feat(push): add telegram bot push notification channel

Implement TelegramPusher in pkg/push, register config schema in channels_definition.go, add validation in model/push_channel.go, update task routing, and update settings-tab.tsx UI validation.
This commit is contained in:
ryan
2026-06-15 14:42:49 +08:00
parent cb018b3b60
commit de58b118b4
18 changed files with 394 additions and 60 deletions
+9 -1
View File
@@ -20,7 +20,7 @@ import (
// ListChannelDefinitions 获取各种消息通道的表单配置定义列表
// @Summary 获取所有消息通道配置字段定义
// @Description 返回系统支持的所有消息通道类型(如飞书、邮件、自定义)的动态表单定义,需要管理员权限
// @Description 返回系统支持的所有消息通道类型(如飞书、邮件、自定义、Telegram)的动态表单定义,需要管理员权限
// @Tags admin-push
// @Produce json
// @Security SessionCookie
@@ -279,6 +279,7 @@ func TestChannel(c *gin.Context) {
c.JSON(http.StatusBadRequest, util.Err(err.Error()))
return
}
url = tempChannel.URL
var config pkgpush.Config
var renderedJSON string
@@ -298,6 +299,13 @@ func TestChannel(c *gin.Context) {
Key: token,
Secret: other,
}
case channelTelegram:
config = pkgpush.Config{
Channel: channelTelegram,
URL: url,
Secret: token,
Key: other,
}
default:
config = pkgpush.Config{
Channel: channelCustom,