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

25 lines
567 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) {
resp = &{{.MethodResponse}}{}
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}}