From 973b84cf8d5989c867201d5a3033eb6ed7c90896 Mon Sep 17 00:00:00 2001 From: Xyfacai Date: Tue, 18 Jun 2024 00:21:02 +0800 Subject: [PATCH] fix: doc --- docs/docs.go | 22 ++++++++++++++++++++++ docs/swagger.json | 22 ++++++++++++++++++++++ docs/swagger.yaml | 14 ++++++++++++++ router.go | 3 ++- 4 files changed, 60 insertions(+), 1 deletion(-) diff --git a/docs/docs.go b/docs/docs.go index ee1a6b9..34a9c6e 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -49,6 +49,28 @@ const docTemplate = `{ } } }, + "/luma/generations/": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Submit luma generate video task", + "responses": { + "200": { + "description": "video tasks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/main.VideoTask" + } + } + } + } + } + }, "/luma/generations/{id}": { "get": { "consumes": [ diff --git a/docs/swagger.json b/docs/swagger.json index 209a0e4..ec5110a 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -37,6 +37,28 @@ } } }, + "/luma/generations/": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Submit luma generate video task", + "responses": { + "200": { + "description": "video tasks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/main.VideoTask" + } + } + } + } + } + }, "/luma/generations/{id}": { "get": { "consumes": [ diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 8064163..4537306 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -64,6 +64,20 @@ paths: $ref: '#/definitions/main.VideoTask' type: array summary: Submit luma generate video task + /luma/generations/: + get: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: video tasks + schema: + items: + $ref: '#/definitions/main.VideoTask' + type: array + summary: Submit luma generate video task /luma/generations/{id}: get: consumes: diff --git a/router.go b/router.go index 0b93fdf..534cac4 100644 --- a/router.go +++ b/router.go @@ -4,6 +4,7 @@ import ( "github.com/gin-gonic/gin" swaggerfiles "github.com/swaggo/files" ginSwagger "github.com/swaggo/gin-swagger" + "luma-api/docs" ) func RegisterRouter(r *gin.Engine) { @@ -12,7 +13,7 @@ func RegisterRouter(r *gin.Engine) { "message": "pong", }) }) - + docs.SwaggerInfo.BasePath = "/" r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler)) apiRouter := r.Group("/luma")