feat(router): support FORM-DATA method type in Gin router generation

This commit is contained in:
kimchen 2024-07-23 17:16:38 +08:00
parent 7043ff132a
commit d6ec6e3eda
1 changed files with 5 additions and 4 deletions

View File

@ -123,12 +123,13 @@ type {{$.LowerName}}Router struct {
func (r *{{$.LowerName}}Router) register() {
{{range .Methods}}
{{if eq .InvokeType 0}}
{{if .Path}}
{{if eq .Method "FORM-DATA" }}
r.iRouter.Handle("POST", "{{.Path}}", r.withMiddleware("POST", "{{.Path}}", r.{{ .HandlerName }})...)
{{end}}
{{if .Path}}
{{else}}
r.iRouter.Handle("{{.Method}}", "{{.Path}}", r.withMiddleware("{{.Method}}", "{{.Path}}", r.{{ .HandlerName }})...)
{{end}}
{{end}}
{{end}}
{{end}}
}