zhou.xiaoning %!s(int64=3) %!d(string=hai) anos
pai
achega
57508fd321
Modificáronse 3 ficheiros con 5 adicións e 2 borrados
  1. 4 0
      api/v1/mq/mq.go
  2. 1 1
      initialize/rabbitmq.go
  3. 0 1
      service/mq/mq.go

+ 4 - 0
api/v1/mq/mq.go

@@ -1,11 +1,13 @@
 package mq
 
 import (
+	"mtp20access/global"
 	"mtp20access/model/common/response"
 	"mtp20access/model/mq/request"
 	"mtp20access/service/mq"
 
 	"github.com/gin-gonic/gin"
+	"go.uber.org/zap"
 )
 
 // SendMsgToMQ 发送总线业务请求
@@ -22,6 +24,8 @@ func SendMsgToMQ(c *gin.Context) {
 	if err := c.ShouldBindJSON(&req); err != nil {
 		response.FailWithMessage("入参不正确", c)
 		return
+	} else {
+		global.M2A_LOG.Info("[C->S]", zap.Any("req", req.FunCodeReq), zap.Any("data", req.Data))
 	}
 
 	if err := mq.SendMQ(c, &req); err != nil {

+ 1 - 1
initialize/rabbitmq.go

@@ -63,7 +63,7 @@ func (t *MQProc) Process(topic, queuename string, msg *[]byte) {
 					}
 				}
 				// 给客户端回调
-				global.M2A_LOG.Info("[S->C]", zap.Any("funcode", funcode), zap.Any("data", string(rspData)))
+				global.M2A_LOG.Info("[S->C]", zap.Any("rsp", funcode), zap.Any("data", string(rspData)))
 				r := rsp.MQBodyRsp{
 					FunCode:     funcode,
 					IsEncrypted: asyncTask.IsEncrypted,

+ 0 - 1
service/mq/mq.go

@@ -63,7 +63,6 @@ func SendMQ(c *gin.Context, req *request.MQBodyReq) (err error) {
 	}
 
 	// 向总线发送业务信息
-	global.M2A_LOG.Info("[C->S]", zap.Any("funcode", req.FunCodeReq), zap.Any("data", string(*bytes)))
 	packet := &global.MQPacket{
 		FunCode:   req.FunCodeReq,
 		SessionId: uint32(claims.SessionID),