proto/goutils/proto_build/tpls/logic_fusen_handler.tpl

24 lines
536 B
Smarty
Raw Normal View History

2023-11-27 09:36:02 +00:00
package {{.PackageName}}
import (
{{if eq .MethodType "rpc"}}
2023-12-06 09:13:51 +00:00
"context"
{{end}}
2023-11-27 09:36:02 +00:00
"{{.ProjectName}}/gen/go/service"
)
{{if eq .MethodType "rpc"}}
2023-12-06 09:13:51 +00:00
func (l *{{.StructName}}) {{.MethodName}}Logic({{range $index, $param := .Params}}{{if $index}}, {{end}}{{$param}}{{end}}) (resp {{.MethodReturn}},err error) {
return resp, err
}
{{else if eq .MethodType "stream"}}
func (l *{{.StructName}}) {{.MethodName}}Logic(stream {{range $index, $param := .Params}}{{if $index}}, {{end}}{{$param}}{{end}}) (err error) {
return err
}
{{end}}