1
0
mirror of https://github.com/go-kratos/kratos.git synced 2026-05-22 10:15:24 +02:00

fix(cmd/protoc-gen-go-http): follow the http rule to use query strings (#1629)

This commit is contained in:
Giovanny Gutiérrez
2021-11-14 22:52:31 -05:00
committed by GitHub
parent 268243d8a3
commit 7a52468ea8
+6
View File
@@ -30,6 +30,12 @@ func _{{$svrType}}_{{.Name}}{{.Num}}_HTTP_Handler(srv {{$svrType}}HTTPServer) fu
if err := ctx.Bind(&in{{.Body}}); err != nil {
return err
}
{{- if not (eq .Body "")}}
if err := ctx.BindQuery(&in); err != nil {
return err
}
{{- end}}
{{- else}}
if err := ctx.BindQuery(&in{{.Body}}); err != nil {
return err