From 2b9ac7d902118f805697f663962ac2d47234d897 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 16 Jun 2022 14:57:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BD=91=E5=85=B3=E6=A8=A1?= =?UTF-8?q?=E5=9D=97api=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gateway/agentmgr_comp.go | 8 ++++---- services/comp_gateroute.go | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/gateway/agentmgr_comp.go b/modules/gateway/agentmgr_comp.go index 1ca3046ee..e69b3f7b1 100644 --- a/modules/gateway/agentmgr_comp.go +++ b/modules/gateway/agentmgr_comp.go @@ -39,7 +39,7 @@ func (this *AgentMgr_Comp) Bind(ctx context.Context, args *pb.AgentBuildReq, rep a.(IAgent).Bind(args.UserId, args.WorkerId) } else { reply.Code = pb.ErrorCode_UserSessionNobeing - reply.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing) + reply.Message = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing) } return nil } @@ -50,7 +50,7 @@ func (this *AgentMgr_Comp) UnBind(ctx context.Context, args *pb.AgentUnBuildReq, a.(IAgent).UnBind() } else { reply.Code = pb.ErrorCode_UserSessionNobeing - reply.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing) + reply.Message = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing) } return nil } @@ -65,7 +65,7 @@ func (this *AgentMgr_Comp) SendMsgToAgent(ctx context.Context, args *pb.AgentSen }) } else { reply.Code = pb.ErrorCode_UserSessionNobeing - reply.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing) + reply.Message = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing) } return nil } @@ -105,7 +105,7 @@ func (this *AgentMgr_Comp) CloseAgent(ctx context.Context, args *pb.AgentCloseeR a.(IAgent).Close() } else { reply.Code = pb.ErrorCode_UserSessionNobeing - reply.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing) + reply.Message = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing) } return nil } diff --git a/services/comp_gateroute.go b/services/comp_gateroute.go index cd6526cda..d6faea977 100644 --- a/services/comp_gateroute.go +++ b/services/comp_gateroute.go @@ -135,6 +135,7 @@ func (this *SComp_GateRouteComp) ReceiveMsg(ctx context.Context, args *pb.AgentM if code.Code != pb.ErrorCode_Success { log.Errorf("HandleUserMsg:%s msg:%v code:%d", args.Method, msg, code) reply.Code = code.Code + reply.Message = pb.GetErrorCodeMsg(code.Code) if code.Data != nil { if d, err := jsoniter.Marshal(code.Data); err != nil { log.Errorf("HandleUserMsg:%s msg:%v code:%d err:%v", args.Method, msg, code, err) @@ -151,6 +152,7 @@ func (this *SComp_GateRouteComp) ReceiveMsg(ctx context.Context, args *pb.AgentM if errcode != pb.ErrorCode_Success { log.Errorf("HandleUserMsg:%s msg:%v code:%d", args.Method, msg, code) reply.Code = errcode + reply.Message = pb.GetErrorCodeMsg(errcode) return nil } } else {