Skip to content

advancevillage/demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

demo

Swagger API 注释提取[swag init -g main/main.go]

  • 目录结构 main/main.go
// @title Restful API demo
// @version 1.1
// @description 实践Restful API
// @contact.name richard
// @contact.email cugriver@163.com
// @license.name Apache 2.0
// @license.url  http://www.apache.org/licenses/LICENSE-2.0.html
// @host localhost:8080
// @BasePath /
// @schemes http https
  • API 函数
// @Summary Show a account
// @Description get string by ID
// @Produce  json
// @Param id path int true "Account ID"
// @Success 200 {object} api.Account
// @Header 200 {string} Token "qwerty"
// @Failure 400 {object} httputil.HTTPError
// @Failure 401 {object} httputil.HTTPError
// @Failure 500 {object} httputil.HTTPError
// @Router /accounts/{id} [get]

构建

  • git submodule update --init --recursive

参考文档

About

restful demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages