Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化脚本 handlergen.sh #16

Closed
xinliangnote opened this issue Mar 13, 2021 · 0 comments
Closed

优化脚本 handlergen.sh #16

xinliangnote opened this issue Mar 13, 2021 · 0 comments

Comments

@xinliangnote
Copy link
Owner

xinliangnote commented Mar 13, 2021

优化脚本 handlergen.sh

  • 调整 interface 中方法注释,新增 @Tags@Router
  • 生成的方法中,新增 swagger 注释信息;

例如:

type Handler interface {
	
	// Create 创建用户
	// @Tags User
	// @Router /user/create [post]
	Create() core.HandlerFunc
}

生成的方法注释如下:

// 创建用户
// @Summary 创建用户
// @Description 创建用户
// @Tags User
// @Accept  json
// @Produce  json
// @Param Request body createRequest true "请求信息"
// @Success 200 {object} createResponse
// @Failure 400 {object} code.Failure
// @Router /user/create [post]
func (h *handler) Create() core.HandlerFunc {}
xinliangnote added a commit that referenced this issue Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant