Closed webees closed 3 years ago
// @summary 用户注册接口 func (a *userApi) SignUp(r *ghttp.Request) { // Some codes }
$ go mod tidy
module thash go 1.15 require ( github.com/gogf/gf v1.15.3 github.com/gogf/swagger v1.2.0 github.com/kr/text v0.2.0 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d // indirect golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43 // indirect golang.org/x/text v0.3.5 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect )
GoFrame CLI Tool v1.15.0, https://goframe.org Install Path: C:\Windows\gf.exe Build Detail: Go Version: go1.15.5 GF Version: v1.15.1 Git Commit: 3b3701b7e8aa5fcc9f12ffc0f567ffce62d6308d Build Time: 2021-01-19 15:21:28
swagger.json
2021-02-20 19:11:12.916 producing swagger files... go: found github.com/swaggo/swag/cmd/swag in github.com/swaggo/swag v1.7.0 go: golang.org/x/text upgrade => v0.3.5 go: golang.org/x/tools upgrade => v0.1.0 go: golang.org/x/net upgrade => v0.0.0-20210220033124-5f55cee0dc0d go: github.com/russross/blackfriday/v2 upgrade => v2.1.0 go: github.com/go-openapi/spec upgrade => v0.20.3 go: gopkg.in/yaml.v2 upgrade => v2.4.0 go: golang.org/x/sys upgrade => v0.0.0-20210220050731-9a76102bfb43 go: github.com/go-openapi/jsonpointer upgrade => v0.19.5 go: github.com/mailru/easyjson upgrade => v0.7.7 go: github.com/cpuguy83/go-md2man/v2 upgrade => v2.0.0 go: github.com/go-openapi/swag upgrade => v0.19.14 go: github.com/go-openapi/jsonreference upgrade => v0.19.5 2021-02-20 19:11:15.094 'swag' �����ڲ����ⲿ���Ҳ���ǿ����еij��� ���������ļ��� exit status 1
$ swag init 2021/02/21 18:21:13 Generate swagger docs.... 2021/02/21 18:21:13 Generate general API Info, search dir:./ 2021/02/21 18:21:21 ParseComment error in file app\api\user.go :cannot find type definition: model.UserApiSignUpReq
api/user.go
go.mod
gf -v
gf swagger --pack
swagger.json
generatedThe following message should be displayed