mirror of https://github.com/zhufuyi/sponge
feat(router): support FORM-DATA method type in Gin router generation
This commit is contained in:
parent
7043ff132a
commit
d6ec6e3eda
|
@ -123,11 +123,12 @@ type {{$.LowerName}}Router struct {
|
||||||
func (r *{{$.LowerName}}Router) register() {
|
func (r *{{$.LowerName}}Router) register() {
|
||||||
{{range .Methods}}
|
{{range .Methods}}
|
||||||
{{if eq .InvokeType 0}}
|
{{if eq .InvokeType 0}}
|
||||||
{{if eq .Method "FORM-DATA" }}
|
|
||||||
r.iRouter.Handle("POST", "{{.Path}}", r.withMiddleware("POST", "{{.Path}}", r.{{ .HandlerName }})...)
|
|
||||||
{{end}}
|
|
||||||
{{if .Path}}
|
{{if .Path}}
|
||||||
r.iRouter.Handle("{{.Method}}", "{{.Path}}", r.withMiddleware("{{.Method}}", "{{.Path}}", r.{{ .HandlerName }})...)
|
{{if eq .Method "FORM-DATA" }}
|
||||||
|
r.iRouter.Handle("POST", "{{.Path}}", r.withMiddleware("POST", "{{.Path}}", r.{{ .HandlerName }})...)
|
||||||
|
{{else}}
|
||||||
|
r.iRouter.Handle("{{.Method}}", "{{.Path}}", r.withMiddleware("{{.Method}}", "{{.Path}}", r.{{ .HandlerName }})...)
|
||||||
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
Loading…
Reference in New Issue