| 1234567891011121314151617181920212223242526272829 |
- package mcp_ai
- import (
- "dbview/service/internal/modules/mcp_ai/handler"
- svc "dbview/service/internal/modules/mcp_ai/service"
- "github.com/gin-gonic/gin"
- )
- // RegisterRoutes 注册 AI 聊天相关路由。
- func RegisterRoutes(r *gin.Engine, svcObj *svc.AIService) {
- if svcObj == nil {
- return
- }
- h := handler.NewHandler(svcObj)
- grp := r.Group("/ai")
- {
- grp.POST("/chat", h.Chat)
- grp.POST("/chat/cancel", h.CancelChat)
- grp.POST("/history", h.History)
- grp.POST("/history/delete", h.DeleteHistory)
- grp.POST("/config/get", h.GetConfig)
- grp.POST("/config/list", h.ListConfigs)
- grp.POST("/config/create", h.CreateConfig)
- grp.POST("/config/update", h.UpdateConfig)
- grp.POST("/config/delete", h.DeleteConfig)
- }
- }
|