Bladeren bron

支持发送铁合金协议转让通知

zhou.xiaoning 3 jaren geleden
bovenliggende
commit
372f6e3088
4 gewijzigde bestanden met toevoegingen van 110 en 8 verwijderingen
  1. 1 0
      global/funcode.go
  2. 19 0
      model/mq/request/ntf.go
  3. 84 8
      res/pb/mtp2.pb.go
  4. 6 0
      res/pb/mtp2.proto

+ 1 - 0
global/funcode.go

@@ -58,6 +58,7 @@ var (
 	SpotPresaleListingOrderRsp = 1441848 // 铁合金现货预售挂牌接口应答(1441848)
 
 	THJPurchaseTradeNtf = 1441865 // 铁合金成交通知
+	PurchaseTransferNtf = 1441846 // 铁合金协议转让通知
 )
 
 // 通过请求功能码获取对应主题的方法

+ 19 - 0
model/mq/request/ntf.go

@@ -41,6 +41,25 @@ func (r *MQNtfReq) GetProtoBytes() (bytes *[]byte, err error) {
 		} else {
 			bytes = &b
 		}
+	case global.PurchaseTransferNtf:
+		m := pb.PurchaseTransferNtf{}
+		if err = r.reflect(r.Data, &m); err != nil {
+			return
+		}
+		if m.Header != nil {
+			m.Header.RequestID = new(uint32)
+			*m.Header.RequestID = 0
+		} else {
+			err = errors.New("请求信息序列化失败")
+			return
+		}
+		if b, e := proto.Marshal(&m); e != nil {
+			global.M2A_LOG.Error(e.Error(), zap.Error(e))
+			err = errors.New("请求信息序列化失败")
+			return
+		} else {
+			bytes = &b
+		}
 	}
 
 	return

+ 84 - 8
res/pb/mtp2.pb.go

@@ -6601,6 +6601,62 @@ func (x *THJPurchaseTradeNtf) GetWRTradeDetailID() uint64 {
 	return 0
 }
 
+// 铁合金协议转让通知
+type PurchaseTransferNtf struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Header     *MessageHead `protobuf:"bytes,1,opt,name=Header" json:"Header,omitempty"`          // 消息头
+	TransferID *uint64      `protobuf:"varint,2,opt,name=TransferID" json:"TransferID,omitempty"` // uint64 协议转让ID
+}
+
+func (x *PurchaseTransferNtf) Reset() {
+	*x = PurchaseTransferNtf{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_mtp2_proto_msgTypes[58]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *PurchaseTransferNtf) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PurchaseTransferNtf) ProtoMessage() {}
+
+func (x *PurchaseTransferNtf) ProtoReflect() protoreflect.Message {
+	mi := &file_mtp2_proto_msgTypes[58]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use PurchaseTransferNtf.ProtoReflect.Descriptor instead.
+func (*PurchaseTransferNtf) Descriptor() ([]byte, []int) {
+	return file_mtp2_proto_rawDescGZIP(), []int{58}
+}
+
+func (x *PurchaseTransferNtf) GetHeader() *MessageHead {
+	if x != nil {
+		return x.Header
+	}
+	return nil
+}
+
+func (x *PurchaseTransferNtf) GetTransferID() uint64 {
+	if x != nil && x.TransferID != nil {
+		return *x.TransferID
+	}
+	return 0
+}
+
 var File_mtp2_proto protoreflect.FileDescriptor
 
 var file_mtp2_proto_rawDesc = []byte{
@@ -7813,7 +7869,13 @@ var file_mtp2_proto_rawDesc = []byte{
 	0x64, 0x52, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x0f, 0x57, 0x52, 0x54,
 	0x72, 0x61, 0x64, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01,
 	0x28, 0x04, 0x52, 0x0f, 0x57, 0x52, 0x54, 0x72, 0x61, 0x64, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69,
-	0x6c, 0x49, 0x44,
+	0x6c, 0x49, 0x44, 0x22, 0x5e, 0x0a, 0x13, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x54,
+	0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4e, 0x74, 0x66, 0x12, 0x27, 0x0a, 0x06, 0x48, 0x65,
+	0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e,
+	0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x65, 0x61, 0x64, 0x52, 0x06, 0x48, 0x65, 0x61,
+	0x64, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x49,
+	0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65,
+	0x72, 0x49, 0x44,
 }
 
 var (
@@ -7828,7 +7890,7 @@ func file_mtp2_proto_rawDescGZIP() []byte {
 	return file_mtp2_proto_rawDescData
 }
 
-var file_mtp2_proto_msgTypes = make([]protoimpl.MessageInfo, 58)
+var file_mtp2_proto_msgTypes = make([]protoimpl.MessageInfo, 59)
 var file_mtp2_proto_goTypes = []interface{}{
 	(*MessageHead)(nil),                         // 0: pb.MessageHead
 	(*ModifyPwdReq)(nil),                        // 1: pb.ModifyPwdReq
@@ -7888,6 +7950,7 @@ var file_mtp2_proto_goTypes = []interface{}{
 	(*SpotPresaleListingOrderReq)(nil),          // 55: pb.SpotPresaleListingOrderReq
 	(*SpotPresaleListingOrderRsp)(nil),          // 56: pb.SpotPresaleListingOrderRsp
 	(*THJPurchaseTradeNtf)(nil),                 // 57: pb.THJPurchaseTradeNtf
+	(*PurchaseTransferNtf)(nil),                 // 58: pb.PurchaseTransferNtf
 }
 var file_mtp2_proto_depIdxs = []int32{
 	0,  // 0: pb.ModifyPwdReq.Header:type_name -> pb.MessageHead
@@ -7948,11 +8011,12 @@ var file_mtp2_proto_depIdxs = []int32{
 	54, // 55: pb.SpotPresaleListingOrderReq.DepositConfigs:type_name -> pb.DepositConfigInfo
 	0,  // 56: pb.SpotPresaleListingOrderRsp.Header:type_name -> pb.MessageHead
 	0,  // 57: pb.THJPurchaseTradeNtf.Header:type_name -> pb.MessageHead
-	58, // [58:58] is the sub-list for method output_type
-	58, // [58:58] is the sub-list for method input_type
-	58, // [58:58] is the sub-list for extension type_name
-	58, // [58:58] is the sub-list for extension extendee
-	0,  // [0:58] is the sub-list for field type_name
+	0,  // 58: pb.PurchaseTransferNtf.Header:type_name -> pb.MessageHead
+	59, // [59:59] is the sub-list for method output_type
+	59, // [59:59] is the sub-list for method input_type
+	59, // [59:59] is the sub-list for extension type_name
+	59, // [59:59] is the sub-list for extension extendee
+	0,  // [0:59] is the sub-list for field type_name
 }
 
 func init() { file_mtp2_proto_init() }
@@ -8657,6 +8721,18 @@ func file_mtp2_proto_init() {
 				return nil
 			}
 		}
+		file_mtp2_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*PurchaseTransferNtf); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -8664,7 +8740,7 @@ func file_mtp2_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_mtp2_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   58,
+			NumMessages:   59,
 			NumExtensions: 0,
 			NumServices:   0,
 		},

+ 6 - 0
res/pb/mtp2.proto

@@ -763,4 +763,10 @@ message SpotPresaleListingOrderRsp {
 message THJPurchaseTradeNtf {
 	optional MessageHead Header = 1; // 消息头
 		optional uint64 WRTradeDetailID = 2; // uint64 预售成交明细ID
+}
+
+// 铁合金协议转让通知
+message PurchaseTransferNtf {
+	optional MessageHead Header = 1; // 消息头
+		optional uint64 TransferID = 2; // uint64 协议转让ID
 }