We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpc接口的调用端可以写出一个通用方法,这样就不用写重复代码了;入参和返回值可以写成通用的。 例如:gochat/api/rpc.go文件,可以改成只用这一个方法就行了。 type TransmitReq struct { Cmd string //例如:CheckAuth Body []byte //例如:proto.CheckAuthResponse{} }
type TransmitRsq struct { Code int64//错误码 Msg string//具体错误信息 Body []byte }
func (rpc *RpcLogic) Transmit(req *TransmitReq,rsq *TransmitRsq) { LogicRpcClient.Call(context.Background(), req.Cmd, req, rsq) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
rpc接口的调用端可以写出一个通用方法,这样就不用写重复代码了;入参和返回值可以写成通用的。
例如:gochat/api/rpc.go文件,可以改成只用这一个方法就行了。
type TransmitReq struct {
Cmd string //例如:CheckAuth
Body []byte //例如:proto.CheckAuthResponse{}
}
type TransmitRsq struct {
Code int64//错误码
Msg string//具体错误信息
Body []byte
}
func (rpc *RpcLogic) Transmit(req *TransmitReq,rsq *TransmitRsq) {
LogicRpcClient.Call(context.Background(), req.Cmd, req, rsq)
}
The text was updated successfully, but these errors were encountered: