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:
committed by
GitHub
parent
268243d8a3
commit
7a52468ea8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user