29 lines
961 B
Go
29 lines
961 B
Go
package router
|
|
|
|
import (
|
|
"github.com/fonchain_enterprise/fonchain-main/pkg/middleware"
|
|
"github.com/fonchain_enterprise/fonchain-main/pkg/service"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func ChatRoute(r *gin.RouterGroup) {
|
|
auth := r.Group("")
|
|
noAuth := r.Group("")
|
|
auth.Use(middleware.CheckLogin(service.AccountProvider), middleware.CheckAuth(service.AccountProvider, service.RuleProvider), middleware.AutoLog(service.AccountProvider, service.GrpcLogImpl))
|
|
chat := auth.Group("chat")
|
|
{
|
|
chat.POST("completion", service.Completion)
|
|
chat.POST("list", service.ChatList)
|
|
chat.POST("create", service.ChatCreate)
|
|
chat.POST("del", service.ChatDel)
|
|
chat.POST("detail", service.ChatDetail)
|
|
chat.POST("completion-text", service.CompletionText)
|
|
}
|
|
noAuthChat := noAuth.Group("chat")
|
|
{
|
|
noAuthChat.POST("app-completion", service.AppCompletion)
|
|
noAuthChat.POST("audio-to-text", service.AudioToText)
|
|
noAuthChat.POST("get-file-text", service.GetFileText)
|
|
}
|
|
}
|