mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Refactor code
This commit is contained in:
parent
b30cb5254e
commit
376f61e213
@ -85,7 +85,7 @@ func AddFriend(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
req := &rpc.AddFriendReq{CommID: &rpc.CommID{}}
|
||||
utils.CopyStructFields(req.CommID, ¶ms)
|
||||
utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend)
|
||||
var ok bool
|
||||
ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
|
||||
if !ok {
|
||||
@ -93,7 +93,7 @@ func AddFriend(c *gin.Context) {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
|
||||
return
|
||||
}
|
||||
log.NewInfo("AddFriend args ", req.String())
|
||||
log.NewInfo(req.CommID.OperationID, "AddFriend args ", req.String())
|
||||
|
||||
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName)
|
||||
client := rpc.NewFriendClient(etcdConn)
|
||||
|
@ -2,14 +2,14 @@ package base_info
|
||||
|
||||
import open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||
|
||||
type paramsCommFriend struct {
|
||||
type ParamsCommFriend struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
ToUserID string `json:"toUserID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
|
||||
type AddBlacklistReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
}
|
||||
type AddBlacklistResp struct {
|
||||
CommResp
|
||||
@ -26,7 +26,7 @@ type ImportFriendResp struct {
|
||||
}
|
||||
|
||||
type AddFriendReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
ReqMsg string `json:"reqMsg"`
|
||||
}
|
||||
type AddFriendResp struct {
|
||||
@ -34,7 +34,7 @@ type AddFriendResp struct {
|
||||
}
|
||||
|
||||
type AddFriendResponseReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
Flag int32 `json:"flag" binding:"required"`
|
||||
HandleMsg string `json:"handleMsg"`
|
||||
}
|
||||
@ -43,14 +43,14 @@ type AddFriendResponseResp struct {
|
||||
}
|
||||
|
||||
type DeleteFriendReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
}
|
||||
type DeleteFriendResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetBlackListReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
}
|
||||
type GetBlackListResp struct {
|
||||
CommResp
|
||||
@ -69,7 +69,7 @@ type BlackUserInfo struct {
|
||||
}
|
||||
|
||||
type SetFriendCommentReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
Remark string `json:"remark" binding:"required"`
|
||||
}
|
||||
type SetFriendCommentResp struct {
|
||||
@ -77,14 +77,14 @@ type SetFriendCommentResp struct {
|
||||
}
|
||||
|
||||
type RemoveBlackListReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
}
|
||||
type RemoveBlackListResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type IsFriendReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
}
|
||||
type IsFriendResp struct {
|
||||
CommResp
|
||||
@ -92,7 +92,7 @@ type IsFriendResp struct {
|
||||
}
|
||||
|
||||
type GetFriendsInfoReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
}
|
||||
type GetFriendsInfoResp struct {
|
||||
CommResp
|
||||
@ -100,7 +100,7 @@ type GetFriendsInfoResp struct {
|
||||
}
|
||||
|
||||
type GetFriendListReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
}
|
||||
type GetFriendListResp struct {
|
||||
CommResp
|
||||
@ -108,7 +108,7 @@ type GetFriendListResp struct {
|
||||
}
|
||||
|
||||
type GetFriendApplyListReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
}
|
||||
type GetFriendApplyListResp struct {
|
||||
CommResp
|
||||
@ -116,7 +116,7 @@ type GetFriendApplyListResp struct {
|
||||
}
|
||||
|
||||
type GetSelfApplyListReq struct {
|
||||
paramsCommFriend
|
||||
ParamsCommFriend
|
||||
}
|
||||
type GetSelfApplyListResp struct {
|
||||
CommResp
|
||||
|
Loading…
x
Reference in New Issue
Block a user