|
|
@ -115,14 +115,7 @@ func (g *DefaultGenerator) genFunction(goPackage string, service parser.Service)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
comment := parser.GetComment(rpc.Doc())
|
|
|
|
comment := parser.GetComment(rpc.Doc())
|
|
|
|
var streamServer string
|
|
|
|
streamServer := fmt.Sprintf("%s.%s_%s%s", goPackage, parser.CamelCase(service.Name), parser.CamelCase(rpc.Name), "Client")
|
|
|
|
if rpc.StreamsRequest && rpc.StreamsReturns {
|
|
|
|
|
|
|
|
streamServer = fmt.Sprintf("%s.%s", goPackage, parser.CamelCase(service.Name)+"_StreamClient")
|
|
|
|
|
|
|
|
} else if rpc.StreamsRequest {
|
|
|
|
|
|
|
|
streamServer = fmt.Sprintf("%s.%s", goPackage, parser.CamelCase(service.Name)+"_ClientStreamClient")
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
streamServer = fmt.Sprintf("%s.%s", goPackage, parser.CamelCase(service.Name)+"_ServerStreamClient")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
buffer, err := util.With("sharedFn").Parse(text).Execute(map[string]interface{}{
|
|
|
|
buffer, err := util.With("sharedFn").Parse(text).Execute(map[string]interface{}{
|
|
|
|
"serviceName": stringx.From(service.Name).ToCamel(),
|
|
|
|
"serviceName": stringx.From(service.Name).ToCamel(),
|
|
|
|
"rpcServiceName": parser.CamelCase(service.Name),
|
|
|
|
"rpcServiceName": parser.CamelCase(service.Name),
|
|
|
@ -155,15 +148,7 @@ func (g *DefaultGenerator) getInterfaceFuncs(goPackage string, service parser.Se
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
comment := parser.GetComment(rpc.Doc())
|
|
|
|
comment := parser.GetComment(rpc.Doc())
|
|
|
|
var streamServer string
|
|
|
|
streamServer := fmt.Sprintf("%s.%s_%s%s", goPackage, parser.CamelCase(service.Name), parser.CamelCase(rpc.Name), "Client")
|
|
|
|
if rpc.StreamsRequest && rpc.StreamsReturns {
|
|
|
|
|
|
|
|
streamServer = fmt.Sprintf("%s.%s", goPackage, parser.CamelCase(service.Name)+"_StreamClient")
|
|
|
|
|
|
|
|
} else if rpc.StreamsRequest {
|
|
|
|
|
|
|
|
streamServer = fmt.Sprintf("%s.%s", goPackage, parser.CamelCase(service.Name)+"_ClientStreamClient")
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
streamServer = fmt.Sprintf("%s.%s", goPackage, parser.CamelCase(service.Name)+"_ServerStreamClient")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
buffer, err := util.With("interfaceFn").Parse(text).Execute(
|
|
|
|
buffer, err := util.With("interfaceFn").Parse(text).Execute(
|
|
|
|
map[string]interface{}{
|
|
|
|
map[string]interface{}{
|
|
|
|
"hasComment": len(comment) > 0,
|
|
|
|
"hasComment": len(comment) > 0,
|
|
|
|