diff --git a/src/app/server/docs/docs.go b/src/app/server/docs/docs.go index 9f6a7a82f1e02faba1ae60f4de59fd6161434b7e..44ad28786a2eca3c5010a782f836c529f8c7aee2 100644 --- a/src/app/server/docs/docs.go +++ b/src/app/server/docs/docs.go @@ -10,6 +10,10 @@ const docTemplate = `{ "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": {}, + "license": { + "name": "MulanPSL2", + "url": "http://license.coscl.org.cn/MulanPSL2" + }, "version": "{{.Version}}" }, "host": "{{.Host}}", @@ -94,12 +98,12 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ - Version: "", - Host: "", - BasePath: "", + Version: "1.0", + Host: "localhost:8888", + BasePath: "/api/v1", Schemes: []string{}, - Title: "", - Description: "", + Title: "PilotGo Swagger API", + Description: "This is a pilotgo server API docs.", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", diff --git a/src/app/server/docs/swagger.json b/src/app/server/docs/swagger.json index 79b7462f0fbd2e5210fdeba1eed55df33d3913f8..803629863d929b409ad4d38398a3bf30170f4907 100644 --- a/src/app/server/docs/swagger.json +++ b/src/app/server/docs/swagger.json @@ -1,8 +1,17 @@ { "swagger": "2.0", "info": { - "contact": {} + "description": "This is a pilotgo server API docs.", + "title": "PilotGo Swagger API", + "contact": {}, + "license": { + "name": "MulanPSL2", + "url": "http://license.coscl.org.cn/MulanPSL2" + }, + "version": "1.0" }, + "host": "localhost:8888", + "basePath": "/api/v1", "paths": { "/api/v1/user/login": { "post": { diff --git a/src/app/server/docs/swagger.yaml b/src/app/server/docs/swagger.yaml index 440fa2fa7d56cf7e8773255778c8b2fe5d1b4ade..7bf7fc6547ea640dbb7c0f0f60d2ab04c53a5591 100644 --- a/src/app/server/docs/swagger.yaml +++ b/src/app/server/docs/swagger.yaml @@ -1,3 +1,4 @@ +basePath: /api/v1 definitions: user.UserInfo: properties: @@ -20,8 +21,15 @@ definitions: required: - email type: object +host: localhost:8888 info: contact: {} + description: This is a pilotgo server API docs. + license: + name: MulanPSL2 + url: http://license.coscl.org.cn/MulanPSL2 + title: PilotGo Swagger API + version: "1.0" paths: /api/v1/user/login: post: diff --git a/src/app/server/main.go b/src/app/server/main.go index 9756e0c8c881714a2eacd860181437fb4f41e3ff..8630acd6ee5f903ad21dc550ad049172172150f2 100644 --- a/src/app/server/main.go +++ b/src/app/server/main.go @@ -19,6 +19,14 @@ import ( _ "gitee.com/openeuler/PilotGo/app/server/docs" ) +// @title PilotGo Swagger API +// @version 1.0 +// @description This is a pilotgo server API docs. +// @license.name MulanPSL2 +// @license.url http://license.coscl.org.cn/MulanPSL2 +// @host localhost:8888 +// @BasePath /api/v1 +// SwaggerUI: http://localhost:8888/swagger/index.html func main() { commands.Execute() }