diff --git a/protoc-gen-go-http/http.go b/protoc-gen-go-http/http.go index 44c6b7f..93e9b7c 100644 --- a/protoc-gen-go-http/http.go +++ b/protoc-gen-go-http/http.go @@ -213,6 +213,7 @@ func buildMethodDesc(g *protogen.GeneratedFile, m *protogen.Method, method, path Request: g.QualifiedGoIdent(m.Input.GoIdent), Reply: g.QualifiedGoIdent(m.Output.GoIdent), Comment: comment, + Comment2: m.Comments.Trailing.String(), Path: replacePathToGinPath(path), Method: method, HasVars: len(vars) > 0, diff --git a/protoc-gen-go-http/template.go b/protoc-gen-go-http/template.go index 0fa96c2..1d886cf 100644 --- a/protoc-gen-go-http/template.go +++ b/protoc-gen-go-http/template.go @@ -11,7 +11,7 @@ var httpTemplate = ` {{$svrName := .ServiceName}} {{- range .MethodSets}} -const Route{{$svrType}}{{.OriginalName}} = "{{.Path}}" {{- if ne .Comment ""}} {{.Comment}} {{- end}} +const Route{{$svrType}}{{.OriginalName}} = "{{.Path}}" {{- if ne .Comment2 ""}} {{.Comment2}} {{- end}} {{- end}} type {{.ServiceType}}HTTPServer interface { @@ -108,6 +108,7 @@ type methodDesc struct { Request string Reply string Comment string + Comment2 string // http_rule Path string Method string