urbanu 1 месяц назад
Родитель
Сommit
d1d1f5109c
2 измененных файлов с 7 добавлено и 0 удалено
  1. 6 0
      apis/daytask/home.go
  2. 1 0
      commons/model/entity/dt_config.go

+ 6 - 0
apis/daytask/home.go

@@ -330,6 +330,12 @@ func (s *Server) OAuthConfig(c *gin.Context) {
 		fmt.Printf("Telegram config error: %v, key: %s\n", err, entity.ConfigKeyTelegramBotName)
 	}
 
+	// 获取 Telegram Bot ID
+	var telegramIdConfig entity.DtConfig
+	if err := db.Where("`key` = ?", entity.ConfigKeyTelegramBotId).First(&telegramIdConfig).Error; err == nil {
+		result["telegramBotId"] = telegramIdConfig.Value
+	}
+
 	ctx.OK(result)
 }
 

+ 1 - 0
commons/model/entity/dt_config.go

@@ -41,6 +41,7 @@ const (
 	ConfigKeyZaloAppId         = "zalo_app_id"        // Zalo App ID
 	ConfigKeyZaloSecret        = "zalo_secret"        // Zalo Secret Key
 	ConfigKeyTelegramBotName   = "telegram_bot_name"  // Telegram Bot 用户名
+	ConfigKeyTelegramBotId     = "telegram_bot_id"    // Telegram Bot 数字ID
 	ConfigKeySmtpHost          = "smtp_host"          // SMTP服务器地址
 	ConfigKeySmtpPort          = "smtp_port"          // SMTP端口
 	ConfigKeySmtpUser          = "smtp_user"          // SMTP用户名(发件邮箱)