From c1a3f45381adb684fc068b59ccd62d0d25d42760 Mon Sep 17 00:00:00 2001 From: Rogee Date: Sat, 21 Dec 2024 10:26:17 +0800 Subject: [PATCH] feat: add swagger doc --- templates/project/main.go.tpl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/templates/project/main.go.tpl b/templates/project/main.go.tpl index 573d0eb..da77824 100755 --- a/templates/project/main.go.tpl +++ b/templates/project/main.go.tpl @@ -7,6 +7,20 @@ import ( log "github.com/sirupsen/logrus" ) +// @title ApiDoc +// @version 1.0 +// @description This is a sample server celler server. +// @termsOfService http://swagger.io/terms/ +// @contact.name UserName +// @contact.url http://www.swagger.io/support +// @contact.email support@swagger.io +// @license.name Apache 2.0 +// @license.url http://www.apache.org/licenses/LICENSE-2.0.html +// @host localhost:8080 +// @BasePath /api/v1 +// @securityDefinitions.basic BasicAuth +// @externalDocs.description OpenAPI +// @externalDocs.url https://swagger.io/resources/open-api/ func main() { opts := []atom.Option{ atom.Name("{{ .ProjectName }}"),