Refactor code

This commit is contained in:
wenxu12345
2021-12-29 16:17:55 +08:00
parent 4e4bab2bf0
commit 4623b5d5db
4 changed files with 174 additions and 113 deletions
+6 -1
View File
@@ -72,8 +72,13 @@ func ImportFriend(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "cImportFriend failed " + err.Error()})
return
}
resp := api.ImportFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}
if resp.ErrCode == 0 {
for _, v := range RpcResp.UserIDResultList {
resp.UserIDResultList = append(resp.UserIDResultList, api.UserIDResult{v.UserID, v.Result})
}
}
resp := api.ImportFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, Data: RpcResp.FailedFriendUserIDList}
log.NewInfo(req.OperationID, "ImportFriend api return ", resp)
c.JSON(http.StatusOK, resp)
}