diff --git a/protoc-gen-go-http/http.go b/protoc-gen-go-http/http.go index 49fe4bd..f81609f 100644 --- a/protoc-gen-go-http/http.go +++ b/protoc-gen-go-http/http.go @@ -85,13 +85,9 @@ func genService(_ *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFi rule, ok := proto.GetExtension(method.Desc.Options(), annotations.E_Http).(*annotations.HttpRule) if rule != nil && ok { for _, bind := range rule.AdditionalBindings { - md := buildHTTPRule(g, method, bind) - sd.Methods = append(sd.Methods, md) - sd.PermissionCodes = append(sd.PermissionCodes, md.PermissionCodes...) + sd.Methods = append(sd.Methods, buildHTTPRule(g, method, bind)) } - md := buildHTTPRule(g, method, rule) - sd.Methods = append(sd.Methods, md) - sd.PermissionCodes = append(sd.PermissionCodes, md.PermissionCodes...) + sd.Methods = append(sd.Methods, buildHTTPRule(g, method, rule)) } else if !omitempty { path := fmt.Sprintf("/%s/%s", service.Desc.FullName(), method.Desc.Name()) sd.Methods = append(sd.Methods, buildMethodDesc(g, method, http.MethodPost, path)) diff --git a/protoc-gen-go-http/template.go b/protoc-gen-go-http/template.go index da17e60..01c5274 100644 --- a/protoc-gen-go-http/template.go +++ b/protoc-gen-go-http/template.go @@ -10,11 +10,6 @@ var httpTemplate = ` {{$svrType := .ServiceType}} {{$svrName := .ServiceName}} -{{- range .PermissionCodes}} - const PermissionCode{{.Name}} = "{{.Code}}" -{{- end}} -// - {{- range .MethodSets}} const Route{{$svrType}}{{.OriginalName}} = "{{.Path}}" {{- if ne .OriginalComment ""}} {{.OriginalComment}} {{.Method}}{{- end}} {{- end}}