feat: 副对话系统 — Webhook 第三方平台接入 (通用/Discord格式支持)
This commit is contained in:
@@ -22,6 +22,7 @@ func Setup(r *gin.Engine, hub *ws.Hub, cfg *config.Config) {
|
||||
sessionHandler := handler.NewSessionHandler(hub)
|
||||
memoryHandler := handler.NewMemoryHandler(cfg.AICoreURL)
|
||||
chatHandler := handler.NewChatHandler(cfg, hub)
|
||||
webhookHandler := handler.NewWebhookHandler(cfg, hub)
|
||||
|
||||
// ========== 公开路由 ==========
|
||||
api := r.Group("/api/v1")
|
||||
@@ -86,6 +87,14 @@ func Setup(r *gin.Engine, hub *ws.Hub, cfg *config.Config) {
|
||||
wsGroup.GET("/chat", chatHandler.HandleWebSocket)
|
||||
}
|
||||
|
||||
// ========== Webhook 路由(第三方平台接入) ==========
|
||||
webhook := r.Group("/api/v1/webhook")
|
||||
webhook.Use(webhookHandler.WebhookAuth())
|
||||
{
|
||||
webhook.POST("/generic", webhookHandler.HandleGenericWebhook)
|
||||
webhook.POST("/discord", webhookHandler.HandleDiscordWebhook)
|
||||
}
|
||||
|
||||
// ========== 静态文件服务 (生产环境) ==========
|
||||
if cfg.Env == "production" {
|
||||
r.Static("/assets", "./public/assets")
|
||||
|
||||
Reference in New Issue
Block a user