|
@@ -19,8 +19,11 @@ type (
|
|
|
Resp = pb.Resp
|
|
|
|
|
|
Resource interface {
|
|
|
+ // 开通或者取消用户/企业权益
|
|
|
PowerHandle(ctx context.Context, in *PowerReq, opts ...grpc.CallOption) (*Resp, error)
|
|
|
+ // 检查用户/企业权益
|
|
|
CheckPower(ctx context.Context, in *CheckPowerReq, opts ...grpc.CallOption) (*Resp, error)
|
|
|
+ // 资源扣减
|
|
|
Deduction(ctx context.Context, in *DeductionReq, opts ...grpc.CallOption) (*Resp, error)
|
|
|
}
|
|
|
|
|
@@ -35,16 +38,19 @@ func NewResource(cli zrpc.Client) Resource {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 开通或者取消用户/企业权益
|
|
|
func (m *defaultResource) PowerHandle(ctx context.Context, in *PowerReq, opts ...grpc.CallOption) (*Resp, error) {
|
|
|
client := pb.NewResourceClient(m.cli.Conn())
|
|
|
return client.PowerHandle(ctx, in, opts...)
|
|
|
}
|
|
|
|
|
|
+// 检查用户/企业权益
|
|
|
func (m *defaultResource) CheckPower(ctx context.Context, in *CheckPowerReq, opts ...grpc.CallOption) (*Resp, error) {
|
|
|
client := pb.NewResourceClient(m.cli.Conn())
|
|
|
return client.CheckPower(ctx, in, opts...)
|
|
|
}
|
|
|
|
|
|
+// 资源扣减
|
|
|
func (m *defaultResource) Deduction(ctx context.Context, in *DeductionReq, opts ...grpc.CallOption) (*Resp, error) {
|
|
|
client := pb.NewResourceClient(m.cli.Conn())
|
|
|
return client.Deduction(ctx, in, opts...)
|