| package router |
|
|
| import ( |
| "github.com/QuantumNous/new-api/controller" |
| "github.com/QuantumNous/new-api/middleware" |
|
|
| "github.com/gin-gonic/gin" |
| ) |
|
|
| func SetVideoRouter(router *gin.Engine) { |
| videoV1Router := router.Group("/v1") |
| videoV1Router.GET("/videos/:task_id/content", controller.VideoProxy) |
| videoV1Router.Use(middleware.TokenAuth(), middleware.Distribute()) |
| { |
| videoV1Router.POST("/video/generations", controller.RelayTask) |
| videoV1Router.GET("/video/generations/:task_id", controller.RelayTask) |
| } |
| |
| |
| { |
| videoV1Router.POST("/videos", controller.RelayTask) |
| videoV1Router.GET("/videos/:task_id", controller.RelayTask) |
| } |
|
|
| klingV1Router := router.Group("/kling/v1") |
| klingV1Router.Use(middleware.KlingRequestConvert(), middleware.TokenAuth(), middleware.Distribute()) |
| { |
| klingV1Router.POST("/videos/text2video", controller.RelayTask) |
| klingV1Router.POST("/videos/image2video", controller.RelayTask) |
| klingV1Router.GET("/videos/text2video/:task_id", controller.RelayTask) |
| klingV1Router.GET("/videos/image2video/:task_id", controller.RelayTask) |
| } |
|
|
| |
| jimengOfficialGroup := router.Group("jimeng") |
| jimengOfficialGroup.Use(middleware.JimengRequestConvert(), middleware.TokenAuth(), middleware.Distribute()) |
| { |
| |
| jimengOfficialGroup.POST("/", controller.RelayTask) |
| } |
| } |
|
|