Refactor code

pull/131/head
wenxu12345 3 years ago
parent f2c0a3994a
commit ac3159193f

@ -414,8 +414,8 @@ func QuitGroup(c *gin.Context) {
return
}
resp := api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}
log.NewInfo(req.OperationID, "QuitGroup api return", RpcResp.String())
c.JSON(http.StatusOK, resp)
log.NewInfo("QuitGroup api return", RpcResp.String())
}
func SetGroupInfo(c *gin.Context) {

@ -478,11 +478,10 @@ func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq)
}
func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq) (*pbGroup.QuitGroupResp, error) {
log.NewError("QuitGroup args ", req.String())
log.NewError(req.OperationID, "QuitGroup args ", req.String())
_, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.OpUserID)
if err != nil {
log.NewError(req.OperationID, "GetGroupMemberInfoByGroupIDAndUserID failed", err.Error(), req.GroupID, req.OpUserID)
log.NewError(req.OperationID, "GetGroupMemberInfoByGroupIDAndUserID failed ", err.Error(), req.GroupID, req.OpUserID)
return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
}
@ -499,7 +498,7 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq)
}
chat.MemberLeaveNotification(req)
log.NewInfo(req.OperationID, "rpc QuitGroup return ")
log.NewInfo(req.OperationID, "rpc QuitGroup return ", pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}})
return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil
}

Loading…
Cancel
Save