pet-ai/server/router/pet/pet_assistant_router.go

26 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package pet
import (
"github.com/gin-gonic/gin"
)
type PetAssistantRouter struct{}
// InitPetAssistantRouter 初始化宠物助手路由信息
func (p *PetAssistantRouter) InitPetAssistantRouter(UserRouter *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
// 宠物助手路由组UserRouter已经应用了UserJWTAuth中间件
petAssistantRouter := UserRouter.Group("pet/user/assistant")
// 获取宠物助手API实例
petAssistantApi := petUserApiGroup.PetAssistantApi
{
// 宠物助手问答相关路由
petAssistantRouter.POST("ask", petAssistantApi.AskPetAssistant) // 宠物助手提问(非流式)
petAssistantRouter.POST("stream-ask", petAssistantApi.StreamAskPetAssistant) // 宠物助手流式提问
petAssistantRouter.GET("history", petAssistantApi.GetAssistantHistory) // 获取宠物助手对话历史
petAssistantRouter.DELETE("clear-history", petAssistantApi.ClearAssistantHistory) // 清空宠物助手对话历史
petAssistantRouter.GET("sessions", petAssistantApi.GetAssistantSessions) // 获取宠物助手会话列表
}
}