Refactor code

This commit is contained in:
wenxu12345 2021-12-29 16:39:52 +08:00
parent 8cd38693dd
commit cf59f57ab8
2 changed files with 2 additions and 3 deletions

View File

@ -69,7 +69,7 @@ func ImportFriend(c *gin.Context) {
RpcResp, err := client.ImportFriend(context.Background(), req) RpcResp, err := client.ImportFriend(context.Background(), req)
if err != nil { if err != nil {
log.NewError(req.OperationID, "ImportFriend failed ", err.Error(), req.String()) log.NewError(req.OperationID, "ImportFriend failed ", err.Error(), req.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "cImportFriend failed "}) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "ImportFriend failed "})
return return
} }
resp := api.ImportFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} resp := api.ImportFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}

View File

@ -156,10 +156,9 @@ func (s *friendServer) AddFriend(ctx context.Context, req *pbFriend.AddFriendReq
return &pbFriend.AddFriendResp{CommonResp: &pbFriend.CommonResp{}}, nil return &pbFriend.AddFriendResp{CommonResp: &pbFriend.CommonResp{}}, nil
} }
//todo
func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFriendReq) (*pbFriend.ImportFriendResp, error) { func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFriendReq) (*pbFriend.ImportFriendResp, error) {
log.NewInfo(req.OperationID, "ImportFriend failed ", req.String()) log.NewInfo(req.OperationID, "ImportFriend failed ", req.String())
var resp pbFriend.ImportFriendResp resp := pbFriend.ImportFriendResp{CommonResp: &pbFriend.CommonResp{}}
var c pbFriend.CommonResp var c pbFriend.CommonResp
if !utils.IsContain(req.OpUserID, config.Config.Manager.AppManagerUid) { if !utils.IsContain(req.OpUserID, config.Config.Manager.AppManagerUid) {