67 lines
2.0 KiB
Go
67 lines
2.0 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// goctl 1.10.1
|
|
// Source: payment.proto
|
|
|
|
package paymentClient
|
|
|
|
import (
|
|
"context"
|
|
|
|
"lone-services/rpc/payment/pb"
|
|
|
|
"github.com/zeromicro/go-zero/zrpc"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
type (
|
|
CloseReq = payment.CloseReq
|
|
NotifyReq = payment.NotifyReq
|
|
PayReq = payment.PayReq
|
|
QueryReq = payment.QueryReq
|
|
RefundReq = payment.RefundReq
|
|
Response = payment.Response
|
|
|
|
Payment interface {
|
|
Pay(ctx context.Context, in *PayReq, opts ...grpc.CallOption) (*Response, error)
|
|
Query(ctx context.Context, in *QueryReq, opts ...grpc.CallOption) (*Response, error)
|
|
Close(ctx context.Context, in *CloseReq, opts ...grpc.CallOption) (*Response, error)
|
|
Refund(ctx context.Context, in *RefundReq, opts ...grpc.CallOption) (*Response, error)
|
|
Notify(ctx context.Context, in *NotifyReq, opts ...grpc.CallOption) (*Response, error)
|
|
}
|
|
|
|
defaultPayment struct {
|
|
cli zrpc.Client
|
|
}
|
|
)
|
|
|
|
func NewPayment(cli zrpc.Client) Payment {
|
|
return &defaultPayment{
|
|
cli: cli,
|
|
}
|
|
}
|
|
|
|
func (m *defaultPayment) Pay(ctx context.Context, in *PayReq, opts ...grpc.CallOption) (*Response, error) {
|
|
client := payment.NewPaymentClient(m.cli.Conn())
|
|
return client.Pay(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultPayment) Query(ctx context.Context, in *QueryReq, opts ...grpc.CallOption) (*Response, error) {
|
|
client := payment.NewPaymentClient(m.cli.Conn())
|
|
return client.Query(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultPayment) Close(ctx context.Context, in *CloseReq, opts ...grpc.CallOption) (*Response, error) {
|
|
client := payment.NewPaymentClient(m.cli.Conn())
|
|
return client.Close(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultPayment) Refund(ctx context.Context, in *RefundReq, opts ...grpc.CallOption) (*Response, error) {
|
|
client := payment.NewPaymentClient(m.cli.Conn())
|
|
return client.Refund(ctx, in, opts...)
|
|
}
|
|
|
|
func (m *defaultPayment) Notify(ctx context.Context, in *NotifyReq, opts ...grpc.CallOption) (*Response, error) {
|
|
client := payment.NewPaymentClient(m.cli.Conn())
|
|
return client.Notify(ctx, in, opts...)
|
|
}
|