mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 12:08:52 +08:00
Refactor code
This commit is contained in:
parent
669ea69357
commit
fb7c4114c1
@ -40,7 +40,7 @@ func main() {
|
|||||||
friendRouterGroup.POST("/remove_blacklist", friend.RemoveBlacklist)
|
friendRouterGroup.POST("/remove_blacklist", friend.RemoveBlacklist)
|
||||||
friendRouterGroup.POST("/delete_friend", friend.DeleteFriend)
|
friendRouterGroup.POST("/delete_friend", friend.DeleteFriend)
|
||||||
friendRouterGroup.POST("/add_friend_response", friend.AddFriendResponse) //1
|
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("/is_friend", friend.IsFriend)
|
||||||
friendRouterGroup.POST("/import_friend", friend.ImportFriend)
|
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"})
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add friend rpc server failed"})
|
||||||
return
|
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)
|
log.NewInfo(req.CommID.OperationID, "IsFriend api return ", resp)
|
||||||
c.JSON(http.StatusOK, resp)
|
c.JSON(http.StatusOK, resp)
|
||||||
}
|
}
|
||||||
|
@ -89,9 +89,12 @@ type RemoveBlackListResp struct {
|
|||||||
type IsFriendReq struct {
|
type IsFriendReq struct {
|
||||||
ParamsCommFriend
|
ParamsCommFriend
|
||||||
}
|
}
|
||||||
|
type Response struct {
|
||||||
|
Friend bool `json:"isFriend"`
|
||||||
|
}
|
||||||
type IsFriendResp struct {
|
type IsFriendResp struct {
|
||||||
CommResp
|
CommResp
|
||||||
Response bool `json:"response"`
|
Response Response `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetFriendsInfoReq struct {
|
type GetFriendsInfoReq struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user