4
0

add event protobuf

This commit is contained in:
dc.To 2025-04-23 15:11:13 +08:00
parent dd73d59689
commit 84304570db
2 changed files with 277 additions and 126 deletions

335
org.pb.go
View File

@ -25,8 +25,8 @@ type State int32
const (
State_Pending State = 0 //处理中
State_Failure State = -1 //支付失败
State_Success State = 1 //支付成功
State_Failure State = -1 //失败
State_Success State = 1 //成功
)
// Enum value maps for State.
@ -659,36 +659,37 @@ func (x *QueryReq) GetRefundNo() string {
return ""
}
type CallbackReq struct {
type EventReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Kid uint64 `protobuf:"varint,1,opt,name=Kid,proto3" json:"Kid,omitempty" dc:"主体ID"` // 主体ID
Uid string `protobuf:"bytes,2,opt,name=Uid,proto3" json:"Uid,omitempty" dc:"用户ID"` // 用户ID
Org string `protobuf:"bytes,3,opt,name=Org,proto3" json:"Org,omitempty" dc:"渠道标识"` //渠道标识
Via string `protobuf:"bytes,4,opt,name=Via,proto3" json:"Via,omitempty" dc:"支付方式"` //支付方式
Url string `protobuf:"bytes,5,opt,name=Url,proto3" json:"Url,omitempty" dc:"URL"` //URL
Action string `protobuf:"bytes,7,opt,name=Action,proto3" json:"Action,omitempty" dc:"Action"` //Action
Query map[string]string `protobuf:"bytes,8,rep,name=Query,proto3" json:"Query,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" dc:"Query"` //Query
Header map[string]string `protobuf:"bytes,9,rep,name=Header,proto3" json:"Header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" dc:"Header"` //Header
Body []byte `protobuf:"bytes,10,opt,name=Body,proto3" json:"Body,omitempty" dc:"回调数据"` //回调数据
Kid uint64 `protobuf:"varint,1,opt,name=Kid,proto3" json:"Kid,omitempty" dc:"主体ID"` //主体ID
Uid string `protobuf:"bytes,2,opt,name=Uid,proto3" json:"Uid,omitempty" dc:"用户ID"` //用户ID
Org string `protobuf:"bytes,3,opt,name=Org,proto3" json:"Org,omitempty" dc:"渠道标识"` //渠道标识
Via string `protobuf:"bytes,4,opt,name=Via,proto3" json:"Via,omitempty" dc:"支付方式"` //支付方式
Url string `protobuf:"bytes,5,opt,name=Url,proto3" json:"Url,omitempty" dc:"URL"` //URL
Event string `protobuf:"bytes,6,opt,name=Event,proto3" json:"Event,omitempty" dc:"事件"` //事件
Action string `protobuf:"bytes,7,opt,name=Action,proto3" json:"Action,omitempty" dc:"Action(渠道方子业务)"` //Action(渠道方子业务)
Query map[string]string `protobuf:"bytes,8,rep,name=Query,proto3" json:"Query,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" dc:"URL参数"` //URL参数
Header map[string]string `protobuf:"bytes,9,rep,name=Header,proto3" json:"Header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" dc:"Header信息"` //Header信息
Body []byte `protobuf:"bytes,10,opt,name=Body,proto3" json:"Body,omitempty" dc:"Body数据"` //Body数据
}
func (x *CallbackReq) Reset() {
*x = CallbackReq{}
func (x *EventReq) Reset() {
*x = EventReq{}
mi := &file_org_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CallbackReq) String() string {
func (x *EventReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CallbackReq) ProtoMessage() {}
func (*EventReq) ProtoMessage() {}
func (x *CallbackReq) ProtoReflect() protoreflect.Message {
func (x *EventReq) ProtoReflect() protoreflect.Message {
mi := &file_org_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -700,74 +701,168 @@ func (x *CallbackReq) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use CallbackReq.ProtoReflect.Descriptor instead.
func (*CallbackReq) Descriptor() ([]byte, []int) {
// Deprecated: Use EventReq.ProtoReflect.Descriptor instead.
func (*EventReq) Descriptor() ([]byte, []int) {
return file_org_proto_rawDescGZIP(), []int{6}
}
func (x *CallbackReq) GetKid() uint64 {
func (x *EventReq) GetKid() uint64 {
if x != nil {
return x.Kid
}
return 0
}
func (x *CallbackReq) GetUid() string {
func (x *EventReq) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *CallbackReq) GetOrg() string {
func (x *EventReq) GetOrg() string {
if x != nil {
return x.Org
}
return ""
}
func (x *CallbackReq) GetVia() string {
func (x *EventReq) GetVia() string {
if x != nil {
return x.Via
}
return ""
}
func (x *CallbackReq) GetUrl() string {
func (x *EventReq) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
func (x *CallbackReq) GetAction() string {
func (x *EventReq) GetEvent() string {
if x != nil {
return x.Event
}
return ""
}
func (x *EventReq) GetAction() string {
if x != nil {
return x.Action
}
return ""
}
func (x *CallbackReq) GetQuery() map[string]string {
func (x *EventReq) GetQuery() map[string]string {
if x != nil {
return x.Query
}
return nil
}
func (x *CallbackReq) GetHeader() map[string]string {
func (x *EventReq) GetHeader() map[string]string {
if x != nil {
return x.Header
}
return nil
}
func (x *CallbackReq) GetBody() []byte {
func (x *EventReq) GetBody() []byte {
if x != nil {
return x.Body
}
return nil
}
type EventRes struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty" dc:"事件类型 order/refund/revoke v:required"` //事件类型 order/refund/revoke v:required
// Types that are assignable to Data:
//
// *EventRes_Orders
// *EventRes_Refunds
Data isEventRes_Data `protobuf_oneof:"Data" dc:"*EventRes_Orders*EventRes_Refunds"`
}
func (x *EventRes) Reset() {
*x = EventRes{}
mi := &file_org_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *EventRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EventRes) ProtoMessage() {}
func (x *EventRes) ProtoReflect() protoreflect.Message {
mi := &file_org_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EventRes.ProtoReflect.Descriptor instead.
func (*EventRes) Descriptor() ([]byte, []int) {
return file_org_proto_rawDescGZIP(), []int{7}
}
func (x *EventRes) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (m *EventRes) GetData() isEventRes_Data {
if m != nil {
return m.Data
}
return nil
}
func (x *EventRes) GetOrders() *Orders {
if x, ok := x.GetData().(*EventRes_Orders); ok {
return x.Orders
}
return nil
}
func (x *EventRes) GetRefunds() *Refunds {
if x, ok := x.GetData().(*EventRes_Refunds); ok {
return x.Refunds
}
return nil
}
type isEventRes_Data interface {
isEventRes_Data()
}
type EventRes_Orders struct {
Orders *Orders `protobuf:"bytes,11,opt,name=Orders,proto3,oneof" dc:"订单信息"` //订单信息
}
type EventRes_Refunds struct {
Refunds *Refunds `protobuf:"bytes,12,opt,name=Refunds,proto3,oneof" dc:"退单信息"` //退单信息
}
func (*EventRes_Orders) isEventRes_Data() {}
func (*EventRes_Refunds) isEventRes_Data() {}
var File_org_proto protoreflect.FileDescriptor
var file_org_proto_rawDesc = []byte{
@ -858,55 +953,66 @@ var file_org_proto_rawDesc = []byte{
0x74, 0x6f, 0x72, 0x65, 0x4e, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65,
0x4e, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65,
0x4e, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x4e, 0x6f, 0x18, 0x0a,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x4e, 0x6f, 0x22, 0xe9,
0x02, 0x0a, 0x0b, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x10,
0x0a, 0x03, 0x4b, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x4b, 0x69, 0x64,
0x12, 0x10, 0x0a, 0x03, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55,
0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x4f, 0x72, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x4f, 0x72, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x56, 0x69, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x56, 0x69, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x72, 0x6c, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x2d, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x17, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x75,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x4e, 0x6f, 0x22, 0xf6,
0x02, 0x0a, 0x08, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x4b,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x4b, 0x69, 0x64, 0x12, 0x10, 0x0a,
0x03, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x69, 0x64, 0x12,
0x10, 0x0a, 0x03, 0x4f, 0x72, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4f, 0x72,
0x67, 0x12, 0x10, 0x0a, 0x03, 0x56, 0x69, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x56, 0x69, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x06,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x41,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x41, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x18, 0x08, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x14, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x2e, 0x51, 0x75,
0x65, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12,
0x30, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x18, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x2e, 0x48, 0x65,
0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x12, 0x12, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x04, 0x42, 0x6f, 0x64, 0x79, 0x1a, 0x38, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a,
0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x37, 0x0a, 0x05, 0x53, 0x74,
0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x10, 0x00,
0x12, 0x14, 0x0a, 0x07, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x10, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73,
0x73, 0x10, 0x01, 0x32, 0xf0, 0x01, 0x0a, 0x03, 0x4f, 0x72, 0x67, 0x12, 0x1a, 0x0a, 0x04, 0x50,
0x2d, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x15, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12,
0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x42, 0x6f,
0x64, 0x79, 0x1a, 0x38, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x81, 0x01, 0x0a, 0x08, 0x45, 0x76, 0x65, 0x6e,
0x74, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x48, 0x00, 0x52, 0x06, 0x4f, 0x72,
0x64, 0x65, 0x72, 0x73, 0x12, 0x2d, 0x0a, 0x07, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x73, 0x18,
0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x73, 0x48, 0x00, 0x52, 0x07, 0x52, 0x65, 0x66, 0x75,
0x6e, 0x64, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x2a, 0x37, 0x0a, 0x05, 0x53,
0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x10,
0x00, 0x12, 0x14, 0x0a, 0x07, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x10, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x10, 0x01, 0x32, 0x8a, 0x02, 0x0a, 0x03, 0x4f, 0x72, 0x67, 0x12, 0x1d, 0x0a, 0x05,
0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x09, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
0x1a, 0x09, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x04, 0x50,
0x69, 0x6e, 0x67, 0x12, 0x08, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x08, 0x2e,
0x50, 0x6f, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x03, 0x50, 0x61, 0x79, 0x12, 0x07,
0x2e, 0x50, 0x61, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x27, 0x0a, 0x06, 0x52, 0x65, 0x66,
0x75, 0x6e, 0x64, 0x12, 0x0a, 0x2e, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a,
0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x66, 0x75, 0x6e,
0x64, 0x73, 0x12, 0x2a, 0x0a, 0x08, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x0c,
0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x29,
0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x09, 0x2e, 0x51,
0x64, 0x73, 0x12, 0x25, 0x0a, 0x06, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x09, 0x2e, 0x51,
0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x2b, 0x0a, 0x0b, 0x51, 0x75, 0x65,
0x72, 0x79, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x12, 0x09, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79,
0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52,
0x65, 0x66, 0x75, 0x6e, 0x64, 0x73, 0x32, 0x36, 0x0a, 0x03, 0x42, 0x73, 0x73, 0x12, 0x2f, 0x0a,
0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x28, 0x01, 0x30, 0x01, 0x42, 0x25,
0x5a, 0x23, 0x67, 0x69, 0x74, 0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x69, 0x69, 0x6f, 0x2e, 0x63, 0x6e,
0x2f, 0x6c, 0x69, 0x6e, 0x6b, 0x70, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x75, 0x66, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x0a, 0x51, 0x75, 0x65,
0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x09, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,
0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x72,
0x64, 0x65, 0x72, 0x73, 0x12, 0x2b, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x66,
0x75, 0x6e, 0x64, 0x12, 0x09, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x11,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64,
0x73, 0x32, 0x36, 0x0a, 0x03, 0x42, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x12, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x72, 0x64,
0x65, 0x72, 0x73, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f,
0x72, 0x64, 0x65, 0x72, 0x73, 0x28, 0x01, 0x30, 0x01, 0x42, 0x25, 0x5a, 0x23, 0x67, 0x69, 0x74,
0x2e, 0x6c, 0x69, 0x6e, 0x6b, 0x69, 0x69, 0x6f, 0x2e, 0x63, 0x6e, 0x2f, 0x6c, 0x69, 0x6e, 0x6b,
0x70, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -922,49 +1028,54 @@ func file_org_proto_rawDescGZIP() []byte {
}
var file_org_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_org_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_org_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_org_proto_goTypes = []any{
(State)(0), // 0: State
(*PingReq)(nil), // 1: PingReq
(*Empty)(nil), // 2: Empty
(*PongRes)(nil), // 3: PongRes
(*PayReq)(nil), // 4: PayReq
(*RefundReq)(nil), // 5: RefundReq
(*QueryReq)(nil), // 6: QueryReq
(*CallbackReq)(nil), // 7: CallbackReq
nil, // 8: PayReq.MetadataEntry
nil, // 9: RefundReq.MetadataEntry
nil, // 10: CallbackReq.QueryEntry
nil, // 11: CallbackReq.HeaderEntry
(*Goods)(nil), // 12: protobuf.Goods
(*Orders)(nil), // 13: protobuf.Orders
(*Refunds)(nil), // 14: protobuf.Refunds
(State)(0), // 0: State
(*PingReq)(nil), // 1: PingReq
(*Empty)(nil), // 2: Empty
(*PongRes)(nil), // 3: PongRes
(*PayReq)(nil), // 4: PayReq
(*RefundReq)(nil), // 5: RefundReq
(*QueryReq)(nil), // 6: QueryReq
(*EventReq)(nil), // 7: EventReq
(*EventRes)(nil), // 8: EventRes
nil, // 9: PayReq.MetadataEntry
nil, // 10: RefundReq.MetadataEntry
nil, // 11: EventReq.QueryEntry
nil, // 12: EventReq.HeaderEntry
(*Goods)(nil), // 13: protobuf.Goods
(*Orders)(nil), // 14: protobuf.Orders
(*Refunds)(nil), // 15: protobuf.Refunds
}
var file_org_proto_depIdxs = []int32{
12, // 0: PayReq.Goods:type_name -> protobuf.Goods
8, // 1: PayReq.Metadata:type_name -> PayReq.MetadataEntry
9, // 2: RefundReq.Metadata:type_name -> RefundReq.MetadataEntry
10, // 3: CallbackReq.Query:type_name -> CallbackReq.QueryEntry
11, // 4: CallbackReq.Header:type_name -> CallbackReq.HeaderEntry
1, // 5: Org.Ping:input_type -> PingReq
4, // 6: Org.Pay:input_type -> PayReq
5, // 7: Org.Refund:input_type -> RefundReq
7, // 8: Org.Callback:input_type -> CallbackReq
6, // 9: Org.QueryOrder:input_type -> QueryReq
6, // 10: Org.QueryRefund:input_type -> QueryReq
13, // 11: Bss.Order:input_type -> protobuf.Orders
3, // 12: Org.Ping:output_type -> PongRes
13, // 13: Org.Pay:output_type -> protobuf.Orders
14, // 14: Org.Refund:output_type -> protobuf.Refunds
13, // 15: Org.Callback:output_type -> protobuf.Orders
13, // 16: Org.QueryOrder:output_type -> protobuf.Orders
14, // 17: Org.QueryRefund:output_type -> protobuf.Refunds
13, // 18: Bss.Order:output_type -> protobuf.Orders
12, // [12:19] is the sub-list for method output_type
5, // [5:12] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
13, // 0: PayReq.Goods:type_name -> protobuf.Goods
9, // 1: PayReq.Metadata:type_name -> PayReq.MetadataEntry
10, // 2: RefundReq.Metadata:type_name -> RefundReq.MetadataEntry
11, // 3: EventReq.Query:type_name -> EventReq.QueryEntry
12, // 4: EventReq.Header:type_name -> EventReq.HeaderEntry
14, // 5: EventRes.Orders:type_name -> protobuf.Orders
15, // 6: EventRes.Refunds:type_name -> protobuf.Refunds
7, // 7: Org.Event:input_type -> EventReq
1, // 8: Org.Ping:input_type -> PingReq
4, // 9: Org.Pay:input_type -> PayReq
5, // 10: Org.Refund:input_type -> RefundReq
6, // 11: Org.Revoke:input_type -> QueryReq
6, // 12: Org.QueryOrder:input_type -> QueryReq
6, // 13: Org.QueryRefund:input_type -> QueryReq
14, // 14: Bss.Order:input_type -> protobuf.Orders
8, // 15: Org.Event:output_type -> EventRes
3, // 16: Org.Ping:output_type -> PongRes
14, // 17: Org.Pay:output_type -> protobuf.Orders
15, // 18: Org.Refund:output_type -> protobuf.Refunds
14, // 19: Org.Revoke:output_type -> protobuf.Orders
14, // 20: Org.QueryOrder:output_type -> protobuf.Orders
15, // 21: Org.QueryRefund:output_type -> protobuf.Refunds
14, // 22: Bss.Order:output_type -> protobuf.Orders
15, // [15:23] is the sub-list for method output_type
7, // [7:15] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_org_proto_init() }
@ -975,13 +1086,17 @@ func file_org_proto_init() {
file_goods_proto_init()
file_orders_proto_init()
file_refunds_proto_init()
file_org_proto_msgTypes[7].OneofWrappers = []any{
(*EventRes_Orders)(nil),
(*EventRes_Refunds)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_org_proto_rawDesc,
NumEnums: 1,
NumMessages: 11,
NumMessages: 12,
NumExtensions: 0,
NumServices: 2,
},

View File

@ -20,10 +20,11 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
Org_Event_FullMethodName = "/Org/Event"
Org_Ping_FullMethodName = "/Org/Ping"
Org_Pay_FullMethodName = "/Org/Pay"
Org_Refund_FullMethodName = "/Org/Refund"
Org_Callback_FullMethodName = "/Org/Callback"
Org_Revoke_FullMethodName = "/Org/Revoke"
Org_QueryOrder_FullMethodName = "/Org/QueryOrder"
Org_QueryRefund_FullMethodName = "/Org/QueryRefund"
)
@ -32,11 +33,11 @@ const (
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type OrgClient interface {
Event(ctx context.Context, in *EventReq, opts ...grpc.CallOption) (*EventRes, error)
Ping(ctx context.Context, in *PingReq, opts ...grpc.CallOption) (*PongRes, error)
Pay(ctx context.Context, in *PayReq, opts ...grpc.CallOption) (*Orders, error)
// rpc Revoke(protobuf.Orders) returns (protobuf.Orders); //撤销
Refund(ctx context.Context, in *RefundReq, opts ...grpc.CallOption) (*Refunds, error)
Callback(ctx context.Context, in *CallbackReq, opts ...grpc.CallOption) (*Orders, error)
Revoke(ctx context.Context, in *QueryReq, opts ...grpc.CallOption) (*Orders, error)
QueryOrder(ctx context.Context, in *QueryReq, opts ...grpc.CallOption) (*Orders, error)
QueryRefund(ctx context.Context, in *QueryReq, opts ...grpc.CallOption) (*Refunds, error)
}
@ -49,6 +50,16 @@ func NewOrgClient(cc grpc.ClientConnInterface) OrgClient {
return &orgClient{cc}
}
func (c *orgClient) Event(ctx context.Context, in *EventReq, opts ...grpc.CallOption) (*EventRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EventRes)
err := c.cc.Invoke(ctx, Org_Event_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orgClient) Ping(ctx context.Context, in *PingReq, opts ...grpc.CallOption) (*PongRes, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PongRes)
@ -79,10 +90,10 @@ func (c *orgClient) Refund(ctx context.Context, in *RefundReq, opts ...grpc.Call
return out, nil
}
func (c *orgClient) Callback(ctx context.Context, in *CallbackReq, opts ...grpc.CallOption) (*Orders, error) {
func (c *orgClient) Revoke(ctx context.Context, in *QueryReq, opts ...grpc.CallOption) (*Orders, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Orders)
err := c.cc.Invoke(ctx, Org_Callback_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, Org_Revoke_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -113,11 +124,11 @@ func (c *orgClient) QueryRefund(ctx context.Context, in *QueryReq, opts ...grpc.
// All implementations must embed UnimplementedOrgServer
// for forward compatibility.
type OrgServer interface {
Event(context.Context, *EventReq) (*EventRes, error)
Ping(context.Context, *PingReq) (*PongRes, error)
Pay(context.Context, *PayReq) (*Orders, error)
// rpc Revoke(protobuf.Orders) returns (protobuf.Orders); //撤销
Refund(context.Context, *RefundReq) (*Refunds, error)
Callback(context.Context, *CallbackReq) (*Orders, error)
Revoke(context.Context, *QueryReq) (*Orders, error)
QueryOrder(context.Context, *QueryReq) (*Orders, error)
QueryRefund(context.Context, *QueryReq) (*Refunds, error)
mustEmbedUnimplementedOrgServer()
@ -130,6 +141,9 @@ type OrgServer interface {
// pointer dereference when methods are called.
type UnimplementedOrgServer struct{}
func (UnimplementedOrgServer) Event(context.Context, *EventReq) (*EventRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method Event not implemented")
}
func (UnimplementedOrgServer) Ping(context.Context, *PingReq) (*PongRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
}
@ -139,8 +153,8 @@ func (UnimplementedOrgServer) Pay(context.Context, *PayReq) (*Orders, error) {
func (UnimplementedOrgServer) Refund(context.Context, *RefundReq) (*Refunds, error) {
return nil, status.Errorf(codes.Unimplemented, "method Refund not implemented")
}
func (UnimplementedOrgServer) Callback(context.Context, *CallbackReq) (*Orders, error) {
return nil, status.Errorf(codes.Unimplemented, "method Callback not implemented")
func (UnimplementedOrgServer) Revoke(context.Context, *QueryReq) (*Orders, error) {
return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented")
}
func (UnimplementedOrgServer) QueryOrder(context.Context, *QueryReq) (*Orders, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryOrder not implemented")
@ -169,6 +183,24 @@ func RegisterOrgServer(s grpc.ServiceRegistrar, srv OrgServer) {
s.RegisterService(&Org_ServiceDesc, srv)
}
func _Org_Event_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EventReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrgServer).Event(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Org_Event_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrgServer).Event(ctx, req.(*EventReq))
}
return interceptor(ctx, in, info, handler)
}
func _Org_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PingReq)
if err := dec(in); err != nil {
@ -223,20 +255,20 @@ func _Org_Refund_Handler(srv interface{}, ctx context.Context, dec func(interfac
return interceptor(ctx, in, info, handler)
}
func _Org_Callback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CallbackReq)
func _Org_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrgServer).Callback(ctx, in)
return srv.(OrgServer).Revoke(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Org_Callback_FullMethodName,
FullMethod: Org_Revoke_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrgServer).Callback(ctx, req.(*CallbackReq))
return srv.(OrgServer).Revoke(ctx, req.(*QueryReq))
}
return interceptor(ctx, in, info, handler)
}
@ -284,6 +316,10 @@ var Org_ServiceDesc = grpc.ServiceDesc{
ServiceName: "Org",
HandlerType: (*OrgServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Event",
Handler: _Org_Event_Handler,
},
{
MethodName: "Ping",
Handler: _Org_Ping_Handler,
@ -297,8 +333,8 @@ var Org_ServiceDesc = grpc.ServiceDesc{
Handler: _Org_Refund_Handler,
},
{
MethodName: "Callback",
Handler: _Org_Callback_Handler,
MethodName: "Revoke",
Handler: _Org_Revoke_Handler,
},
{
MethodName: "QueryOrder",