feat: add support
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package supportClient
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
support "lone-services/rpc/support/pb"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
CallReq = support.CallReq
|
||||
Response = support.Response
|
||||
|
||||
Support interface {
|
||||
Call(ctx context.Context, in *CallReq, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
defaultSupport struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewSupport(cli zrpc.Client) Support {
|
||||
return &defaultSupport{cli: cli}
|
||||
}
|
||||
|
||||
func (m *defaultSupport) Call(ctx context.Context, in *CallReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := support.NewSupportClient(m.cli.Conn())
|
||||
return client.Call(ctx, in, opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user