Przeglądaj źródła

增加多个总线业务接口

zhou.xiaoning 3 lat temu
rodzic
commit
9d3907df17
3 zmienionych plików z 7917 dodań i 236 usunięć
  1. 1 2
      global/funcode.go
  2. 350 2
      initialize/rabbitmq.go
  3. 7566 232
      res/pb/mtp2.pb.go

+ 1 - 2
global/funcode.go

@@ -24,7 +24,7 @@ var (
 	T2bBankDepositRsp    = 589844 // 入金应答
 
 	WarehouseApplyReq                   = 1900685 // 仓库申请请求
-	WarehouseApplyRsp                   = 1900686 // 仓库申请请求
+	WarehouseApplyRsp                   = 1900686 // 仓库申请应答
 	PerformanceContractedApplyReq       = 1310729 // 违约申请请求
 	PerformanceContractedApplyRsp       = 1310730 // 违约申请应答
 	PerformanceDelayApplyReq            = 1310725 // 延期申请请求
@@ -35,7 +35,6 @@ var (
 	PerformanceModifyContactRsp         = 1310736 // 履约修改联络信息回应
 	GoodsFavoriteOperateReq             = 1441843 // 商品收藏操作接口请求
 	GoodsFavoriteOperateRsp             = 1441844 // 商品收藏操作接口应答
-	GZBuyOrderDetailExInfo              = 1441826 // 钻石买挂牌属性
 	ZSBuyOrderListingReq                = 1441837 // 钻石买挂牌接口请求
 	ZSBuyOrderListingRsp                = 1441838 // 钻石买挂牌接口应答
 	ZSSellOrderListingReq               = 1441829 // 钻石卖挂牌接口请求

+ 350 - 2
initialize/rabbitmq.go

@@ -82,6 +82,214 @@ func (t *MQProc) getRspProtobuf(msg *[]byte) (funcode uint32, sessionId uint32,
 	b := (*msg)[8:]
 
 	switch int(funcode) {
+	case global.ModifyPwdRsp: // 修改账户密码应答
+		var p pb.ModifyPwdRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.UserReceiveInfoRsp: // 新增修改收货地址请求响应
+		var p pb.UserReceiveInfoRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.DelUserReceiveInfoRsp: // 删除收货地址请求响应
+		var p pb.DelUserReceiveInfoRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.UserReceiptInfoRsp: // 新增修改用户发票信息请求响应
+		var p pb.UserReceiptInfoRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.DelUserReceiptInfoRsp: // 删除用户发票信息请求响应
+		var p pb.DelUserReceiptInfoRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.T2bBankSignRsp: // 签约应答
+		var p pb.T2BBankSignRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.T2bBankCancelSignRsp: // 解约应答
+		var p pb.T2BBankCancelSignRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.T2bBankWithdrawRsp: // 出金应答
+		var p pb.T2BBankWithdrawRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.T2bBankDepositRsp: // 入金应答
+		var p pb.T2BBankDepositRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.WarehouseApplyRsp: // 仓库申请应答
+		var p pb.WarehouseApplyRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.PerformanceContractedApplyRsp: // 违约申请应答
+		var p pb.PerformanceContractedApplyRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.PerformanceDelayApplyRsp: // 延期申请应答
+		var p pb.PerformanceDelayApplyRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.PerformanceManualConfirmRsp: // 履约手动确认应答
+		var p pb.PerformanceManualConfirmRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.PerformanceModifyContactRsp: // 履约修改联络信息回应
+		var p pb.PerformanceModifyContactRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.GoodsFavoriteOperateRsp: // 商品收藏操作接口应答
+		var p pb.GoodsFavoriteOperateRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.ZSBuyOrderListingRsp: // 钻石买挂牌接口应答
+		var p pb.ZSBuyOrderListingRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
 	case global.ZSSellOrderListingRsp: // 钻石卖挂牌接口响应
 		var p pb.ZSSellOrderListingRsp
 		if err = proto.Unmarshal(b, &p); err != nil {
@@ -95,6 +303,84 @@ func (t *MQProc) getRspProtobuf(msg *[]byte) (funcode uint32, sessionId uint32,
 			bytes = &bs
 			serialNumber = p.GetHeader().GetRequestID()
 		}
+	case global.ZSBuyOrderDestingRsp: // 钻石卖摘牌申请接口响应
+		var p pb.ZSBuyOrderDestingRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.ZSSellOrderDestingApplyOperateRsp: // 钻石卖摘牌申请操作接口应答
+		var p pb.ZSSellOrderDestingApplyOperateRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.ZSBuyOrderDestingNegPriceRsp: // 买摘牌询价接口应答
+		var p pb.ZSBuyOrderDestingNegPriceRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.ZSBuyOrderDestingNegPriceOperateRsp: // 买摘牌询价操作接口应答
+		var p pb.ZSBuyOrderDestingNegPriceOperateRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.WRListingCancelOrderRsp: // 挂牌撤单应答
+		var p pb.WRListingCancelOrderRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
+	case global.ReceiptZSOutApplyRsp: // 钻石出库申请接口响应
+		var p pb.ReceiptZSOutApplyRsp
+		if err = proto.Unmarshal(b, &p); err != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		}
+		if bs, e := protojson.Marshal(&p); e != nil {
+			global.M2A_LOG.Error("总线回复数据反序列化失败", zap.Error(err))
+			return
+		} else {
+			bytes = &bs
+			serialNumber = p.GetHeader().GetRequestID()
+		}
 	}
 
 	return
@@ -103,10 +389,35 @@ func (t *MQProc) getRspProtobuf(msg *[]byte) (funcode uint32, sessionId uint32,
 // RabbitMQSubscribeTopic 订阅主题
 func RabbitMQSubscribeTopic() (err error) {
 	// 订阅需要的总线响应主题
+	if err = global.SubscribeTopic(global.TOPIC_RSP_QKERNEL); err != nil {
+		global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
+		return
+	}
+	if err = global.SubscribeTopic(global.TOPIC_MANAGE_RSP); err != nil {
+		global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
+		return
+	}
+	if err = global.SubscribeTopic(global.TOPIC_RSP_BANK); err != nil {
+		global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
+		return
+	}
+	if err = global.SubscribeTopic(global.TOPIC_PERFORMANCE_RSP); err != nil {
+		global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
+		return
+	}
+	if err = global.SubscribeTopic(global.TOPIC_WAREHOUSE_RECIEPT_RSP); err != nil {
+		global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
+		return
+	}
+	if err = global.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_TRADE); err != nil {
+		global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
+		return
+	}
 	if err = global.SubscribeTopic(global.TOPIC_RSP_WAREHOUSE_TRADE_GZ); err != nil {
 		global.M2A_LOG.Error("rabbitmq subscribe topic failed, err:", zap.Error(err))
 		return
 	}
+
 	global.M2A_LOG.Info("rabbitmq subscribe topic successed.")
 
 	return
@@ -129,6 +440,43 @@ func InitFuncodeTopic() {
 		global.M2A_FuncodeTopic = make(map[string][]int)
 	}
 
-	//global.M2A_FuncodeTopic[global.ModifyPwdReq] =
-	//global.M2A_FuncodeTopic[global.ZSSellOrderListingReq] = global.TOPIC_REQ_WAREHOUSE_TRADE_GZ
+	global.M2A_FuncodeTopic[global.TOPIC_REQ_QKERNEL] = []int{
+		global.ModifyPwdReq,
+	}
+	global.M2A_FuncodeTopic[global.TOPIC_MANAGE_REQ] = []int{
+		global.UserReceiveInfoReq,
+		global.DelUserReceiveInfoReq,
+		global.UserReceiveIsDefaultReq,
+		global.UserReceiptInfoReq,
+		global.DelUserReceiptInfoReq,
+		global.WarehouseApplyReq,
+	}
+	global.M2A_FuncodeTopic[global.TOPIC_REQ_BANK] = []int{
+		global.T2bBankSignReq,
+		global.T2bBankCancelSignReq,
+		global.T2bBankWithdrawReq,
+		global.T2bBankDepositReq,
+	}
+	global.M2A_FuncodeTopic[global.TOPIC_PERFORMANCE_REQ] = []int{
+		global.PerformanceContractedApplyReq,
+		global.PerformanceDelayApplyReq,
+		global.PerformanceManualConfirmReq,
+		global.PerformanceModifyContactReq,
+	}
+	global.M2A_FuncodeTopic[global.TOPIC_WAREHOUSE_RECIEPT] = []int{
+		global.ReceiptZSOutApplyReq,
+	}
+	global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_TRADE] = []int{
+		global.WRListingCancelOrderReq,
+	}
+	global.M2A_FuncodeTopic[global.TOPIC_REQ_WAREHOUSE_TRADE_GZ] = []int{
+		global.GoodsFavoriteOperateReq,
+		global.ZSBuyOrderListingReq,
+		global.ZSSellOrderListingReq,
+		global.ZSBuyOrderDestingReq,
+		global.ZSSellOrderDestingApplyReq,
+		global.ZSSellOrderDestingApplyOperateReq,
+		global.ZSBuyOrderDestingNegPriceReq,
+		global.ZSBuyOrderDestingNegPriceOperateReq,
+	}
 }

Plik diff jest za duży
+ 7566 - 232
res/pb/mtp2.pb.go


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików