Refactor code

pull/131/head
wenxu12345 3 years ago
parent 669ea69357
commit fb7c4114c1

@ -40,7 +40,7 @@ func main() {
friendRouterGroup.POST("/remove_blacklist", friend.RemoveBlacklist)
friendRouterGroup.POST("/delete_friend", friend.DeleteFriend)
friendRouterGroup.POST("/add_friend_response", friend.AddFriendResponse) //1
friendRouterGroup.POST("/set_friend_remark", friend.SetFriendRemark)
friendRouterGroup.POST("/set_friend_remark", friend.SetFriendRemark) //1
friendRouterGroup.POST("/is_friend", friend.IsFriend)
friendRouterGroup.POST("/import_friend", friend.ImportFriend)
}

@ -305,7 +305,9 @@ func IsFriend(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add friend rpc server failed"})
return
}
resp := api.IsFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, Response: RpcResp.Response}
resp := api.IsFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
resp.Response.Friend = RpcResp.Response
log.NewInfo(req.CommID.OperationID, "IsFriend api return ", resp)
c.JSON(http.StatusOK, resp)
}

@ -89,9 +89,12 @@ type RemoveBlackListResp struct {
type IsFriendReq struct {
ParamsCommFriend
}
type Response struct {
Friend bool `json:"isFriend"`
}
type IsFriendResp struct {
CommResp
Response bool `json:"response"`
Response Response `json:"data"`
}
type GetFriendsInfoReq struct {

Loading…
Cancel
Save