From 24251d97623c789859041e0bc462a43fce8dcfaa Mon Sep 17 00:00:00 2001 From: sunjiayu <767978963@qq.com> Date: Tue, 16 Jul 2024 22:21:44 +0800 Subject: [PATCH] add orderType --- wx_payment/wx_payment.pb.go | 74 +++++++++++++++++++------------- wx_payment/wx_payment.pb.gw.go | 12 +++--- wx_payment/wx_payment_grpc.pb.go | 14 +++--- 3 files changed, 57 insertions(+), 43 deletions(-) diff --git a/wx_payment/wx_payment.pb.go b/wx_payment/wx_payment.pb.go index 02b1b9b..9ae235b 100644 --- a/wx_payment/wx_payment.pb.go +++ b/wx_payment/wx_payment.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.0 +// protoc-gen-go v1.34.1 +// protoc v5.27.1 // source: wx_payment/wx_payment.proto package wx_payment @@ -325,8 +325,9 @@ type JsApiRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Openid string `protobuf:"bytes,1,opt,name=openid,proto3" json:"openid,omitempty"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` // 订单金额,单位是分 + Openid string `protobuf:"bytes,1,opt,name=openid,proto3" json:"openid,omitempty"` + Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` // 订单金额,单位是分 + DataPlatformOrderType int32 `protobuf:"varint,3,opt,name=data_platform_order_type,json=dataPlatformOrderType,proto3" json:"data_platform_order_type,omitempty"` // 后台透传orderType } func (x *JsApiRequest) Reset() { @@ -375,6 +376,13 @@ func (x *JsApiRequest) GetAmount() uint64 { return 0 } +func (x *JsApiRequest) GetDataPlatformOrderType() int32 { + if x != nil { + return x.DataPlatformOrderType + } + return 0 +} + type JsApiResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -963,36 +971,40 @@ var file_wx_payment_wx_payment_proto_rawDesc = []byte{ 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x72, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x0a, 0x0c, 0x4a, 0x73, 0x41, 0x70, 0x69, 0x52, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x77, 0x0a, 0x0c, 0x4a, 0x73, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x9c, 0x01, 0x0a, 0x0d, 0x4a, 0x73, 0x41, 0x70, 0x69, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x5f, - 0x73, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x6e, 0x63, 0x65, - 0x53, 0x74, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x61, - 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, - 0x79, 0x53, 0x69, 0x67, 0x6e, 0x32, 0x62, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x10, 0x6a, 0x73, 0x61, 0x70, 0x69, 0x5f, - 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x75, 0x72, 0x6c, 0x12, 0x1c, 0x2e, 0x77, 0x78, 0x5f, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x72, - 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x77, 0x78, 0x5f, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x72, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x52, 0x0a, 0x10, 0x57, 0x78, 0x50, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, - 0x05, 0x6a, 0x73, 0x61, 0x70, 0x69, 0x12, 0x18, 0x2e, 0x77, 0x78, 0x5f, 0x70, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x73, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x19, 0x2e, 0x77, 0x78, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x73, - 0x41, 0x70, 0x69, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x34, 0x5a, - 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x75, 0x73, - 0x75, 0x6e, 0x6a, 0x79, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x69, 0x2d, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x77, 0x78, 0x5f, 0x70, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x18, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x64, 0x61, 0x74, 0x61, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, + 0x9c, 0x01, 0x0a, 0x0d, 0x4a, 0x73, 0x41, 0x70, 0x69, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x12, 0x18, 0x0a, 0x07, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x32, 0x62, + 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x51, 0x0a, 0x10, 0x6a, 0x73, 0x61, 0x70, 0x69, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, + 0x75, 0x72, 0x6c, 0x12, 0x1c, 0x2e, 0x77, 0x78, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x77, 0x78, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x32, 0x52, 0x0a, 0x10, 0x57, 0x78, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x05, 0x6a, 0x73, 0x61, 0x70, 0x69, 0x12, + 0x18, 0x2e, 0x77, 0x78, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x73, 0x41, + 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x77, 0x78, 0x5f, 0x70, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4a, 0x73, 0x41, 0x70, 0x69, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x75, 0x73, 0x75, 0x6e, 0x6a, 0x79, 0x2f, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x69, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x77, 0x78, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/wx_payment/wx_payment.pb.gw.go b/wx_payment/wx_payment.pb.gw.go index f249f85..c3b3970 100644 --- a/wx_payment/wx_payment.pb.gw.go +++ b/wx_payment/wx_payment.pb.gw.go @@ -154,21 +154,21 @@ func RegisterWxPaymentServiceHandlerServer(ctx context.Context, mux *runtime.Ser // RegisterNotifyServiceHandlerFromEndpoint is same as RegisterNotifyServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterNotifyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() @@ -225,21 +225,21 @@ var ( // RegisterWxPaymentServiceHandlerFromEndpoint is same as RegisterWxPaymentServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterWxPaymentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.DialContext(ctx, endpoint, opts...) + conn, err := grpc.NewClient(endpoint, opts...) if err != nil { return err } defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) } }() }() diff --git a/wx_payment/wx_payment_grpc.pb.go b/wx_payment/wx_payment_grpc.pb.go index d014523..6b5625d 100644 --- a/wx_payment/wx_payment_grpc.pb.go +++ b/wx_payment/wx_payment_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.27.0 +// - protoc-gen-go-grpc v1.4.0 +// - protoc v5.27.1 // source: wx_payment/wx_payment.proto package wx_payment @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 const ( NotifyService_JsapiNotifyUrl_FullMethodName = "/wx_payment.NotifyService/jsapi_notify_url" @@ -38,8 +38,9 @@ func NewNotifyServiceClient(cc grpc.ClientConnInterface) NotifyServiceClient { } func (c *notifyServiceClient) JsapiNotifyUrl(ctx context.Context, in *NotifyUrlRequest, opts ...grpc.CallOption) (*NotifyUrlResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(NotifyUrlResponse) - err := c.cc.Invoke(ctx, NotifyService_JsapiNotifyUrl_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, NotifyService_JsapiNotifyUrl_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -128,8 +129,9 @@ func NewWxPaymentServiceClient(cc grpc.ClientConnInterface) WxPaymentServiceClie } func (c *wxPaymentServiceClient) Jsapi(ctx context.Context, in *JsApiRequest, opts ...grpc.CallOption) (*JsApiResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(JsApiResponse) - err := c.cc.Invoke(ctx, WxPaymentService_Jsapi_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, WxPaymentService_Jsapi_FullMethodName, in, out, cOpts...) if err != nil { return nil, err }