Skip to content

Commit

Permalink
feat: add Comment2
Browse files Browse the repository at this point in the history
  • Loading branch information
fynntang committed Aug 29, 2023
1 parent 59aa60a commit 6ddd4c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions protoc-gen-go-http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion protoc-gen-go-http/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -108,6 +108,7 @@ type methodDesc struct {
Request string
Reply string
Comment string
Comment2 string
// http_rule
Path string
Method string
Expand Down

0 comments on commit 6ddd4c6

Please sign in to comment.