|
|
|
@ -1,18 +1,21 @@
|
|
|
|
|
/**
|
|
|
|
|
功能:{{.description}}
|
|
|
|
|
作者:{{.authorName}}
|
|
|
|
|
时间:{{.currenttime}}
|
|
|
|
|
*/
|
|
|
|
|
func {{.interfaceName}}({{.Parameters}}) (*{{.tableName}}Proto.Reply, error) {
|
|
|
|
|
//1、准备动作:连接服务器
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := {{.tableName}}Proto.New{{.tableName}}ManageClient(conn)
|
|
|
|
|
Reply, err := c.{{.interfaceName}}(ctx, &{{.tableName}}Proto.{{.argPrefix}}{{.RpcServiceParameters}})
|
|
|
|
|
if err != nil {
|
|
|
|
|
LogUtil.Error("{{.description}}错误: ", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return Reply, err
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
功能:{{.description}}
|
|
|
|
|
作者:{{.authorName}}
|
|
|
|
|
时间:{{.currenttime}}
|
|
|
|
|
*/
|
|
|
|
|
func {{.interfaceName}}({{.Parameters}}) (*{{.tableName}}Proto.Reply, error) {
|
|
|
|
|
//1、准备动作:连接服务器
|
|
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
conn := GRpcUtil.GetConnection()
|
|
|
|
|
if conn == nil {
|
|
|
|
|
return nil, errors.New("RPC服务未启动!")
|
|
|
|
|
}
|
|
|
|
|
//2、业务传参
|
|
|
|
|
c := {{.tableName}}Proto.New{{.tableName}}ManageClient(conn)
|
|
|
|
|
Reply, err := c.{{.interfaceName}}(ctx, &{{.tableName}}Proto.{{.argPrefix}}{{.RpcServiceParameters}})
|
|
|
|
|
if err != nil {
|
|
|
|
|
LogUtil.Error("{{.description}}错误: ", err.Error())
|
|
|
|
|
}
|
|
|
|
|
return Reply, err
|
|
|
|
|
}
|
|
|
|
|