From 5dd494d9a2e55a315cfa6504368c7175f11e4810 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 16:01:48 +0800 Subject: [PATCH 1/5] ReceiveMessageOpt debug log --- internal/api/conversation/conversation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index f08b1103b..f1e1fd05a 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -128,9 +128,9 @@ func GetReceiveMessageOpt(c *gin.Context) { for _, v := range resp.ConversationOptResult { var opt OptResult - log.NewDebug("CopyStructFields begin ", v, req.OperationID) + log.NewInfo("CopyStructFields begin ", v, req.OperationID) err := utils.CopyStructFields(&opt, v) - log.NewDebug("CopyStructFields end ", v, req.OperationID) + log.NewInfo("CopyStructFields end ", v, req.OperationID) if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) continue From 19489afefc0e22c60f8575d87ce20de49976ab44 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 16:07:56 +0800 Subject: [PATCH 2/5] ReceiveMessageOpt debug log --- internal/api/conversation/conversation.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index f1e1fd05a..3840ee987 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -122,6 +122,7 @@ func GetReceiveMessageOpt(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "GetReceiveMessageOpt rpc failed, " + err.Error()}) return } + log.NewInfo(req.OperationID, "GetReceiveMessageOptReq req: ", req, resp) var ginResp GetReceiveMessageOptResp ginResp.ErrCode = resp.ErrCode ginResp.ErrMsg = resp.ErrMsg @@ -171,7 +172,7 @@ func SetReceiveMessageOpt(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "SetReceiveMessageOpt rpc failed, " + err.Error()}) return } - + log.NewInfo(req.OperationID, "SetReceiveMessageOpt req: ", req, resp) ginResp := SetReceiveMessageOptResp{ ErrCode: resp.ErrCode, ErrMsg: resp.ErrMsg, From 31212d4f4b39a68c871d3853c26e0ed3a1b97007 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 16:10:49 +0800 Subject: [PATCH 3/5] ReceiveMessageOpt debug log --- internal/api/conversation/conversation.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 3840ee987..b8c96fc28 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -180,7 +180,9 @@ func SetReceiveMessageOpt(c *gin.Context) { for _, v := range resp.OptResult { var opt OptResult + log.NewDebug("CopyStructFields begin ", v, req.OperationID) err := utils.CopyStructFields(&opt, v) + log.NewDebug("CopyStructFields end ", v, req.OperationID) if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) continue From 053792e89da7d6199616f71dd2ff9f5887f0b7b6 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 16:12:55 +0800 Subject: [PATCH 4/5] ReceiveMessageOpt debug log --- internal/api/conversation/conversation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index b8c96fc28..4d0330f77 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -181,7 +181,7 @@ func SetReceiveMessageOpt(c *gin.Context) { for _, v := range resp.OptResult { var opt OptResult log.NewDebug("CopyStructFields begin ", v, req.OperationID) - err := utils.CopyStructFields(&opt, v) + err := utils.CopyStructFields(&opt, *v, "ConversationId", "Result") log.NewDebug("CopyStructFields end ", v, req.OperationID) if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) From d7028f22e20a24e42418aae528e518c9bfa57500 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 16:15:21 +0800 Subject: [PATCH 5/5] fix bug --- internal/api/conversation/conversation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 4d0330f77..718af6f9f 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -82,7 +82,7 @@ func GetAllConversationMessageOpt(c *gin.Context) { ginResp.ErrMsg = resp.ErrMsg for _, v := range resp.ConversationOptResult { var opt OptResult - err := utils.CopyStructFields(&opt, v) + err := utils.CopyStructFields(&opt, *v, "ConversationId", "Result") if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) continue @@ -130,7 +130,7 @@ func GetReceiveMessageOpt(c *gin.Context) { for _, v := range resp.ConversationOptResult { var opt OptResult log.NewInfo("CopyStructFields begin ", v, req.OperationID) - err := utils.CopyStructFields(&opt, v) + err := utils.CopyStructFields(&opt, *v, "ConversationId", "Result") log.NewInfo("CopyStructFields end ", v, req.OperationID) if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error())