proto/goutils/proto_build/tpls/logic_fusen_handler.tpl
2023-12-07 17:22:05 +08:00

24 lines
536 B
Smarty

package {{.PackageName}}
import (
{{if eq .MethodType "rpc"}}
"context"
{{end}}
"{{.ProjectName}}/gen/go/service"
)
{{if eq .MethodType "rpc"}}
func (l *{{.StructName}}) {{.MethodName}}Logic({{range $index, $param := .Params}}{{if $index}}, {{end}}{{$param}}{{end}}) (resp {{.MethodReturn}},err error) {
return resp, nil
}
{{else if eq .MethodType "stream"}}
func (l *{{.StructName}}) {{.MethodName}}Logic(stream {{range $index, $param := .Params}}{{if $index}}, {{end}}{{$param}}{{end}}) (err error) {
return nil
}
{{end}}