mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-06-03 14:31:43 +08:00
Refactor code
This commit is contained in:
parent
cf59f57ab8
commit
95a771c2fb
@ -54,7 +54,7 @@ func ImportFriend(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
req := &rpc.ImportFriendReq{}
|
req := &rpc.ImportFriendReq{}
|
||||||
utils.CopyStructFields(req, ¶ms)
|
utils.CopyStructFields(req, ¶ms.ParamsCommFriend)
|
||||||
var ok bool
|
var ok bool
|
||||||
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
|
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -157,7 +157,7 @@ func (s *friendServer) AddFriend(ctx context.Context, req *pbFriend.AddFriendReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 args ", req.String())
|
||||||
resp := pbFriend.ImportFriendResp{CommonResp: &pbFriend.CommonResp{}}
|
resp := pbFriend.ImportFriendResp{CommonResp: &pbFriend.CommonResp{}}
|
||||||
var c pbFriend.CommonResp
|
var c pbFriend.CommonResp
|
||||||
|
|
||||||
|
@ -17,8 +17,7 @@ type AddBlacklistResp struct {
|
|||||||
|
|
||||||
type ImportFriendReq struct {
|
type ImportFriendReq struct {
|
||||||
FriendUserIDList []string `json:"friendUserIDList" binding:"required"`
|
FriendUserIDList []string `json:"friendUserIDList" binding:"required"`
|
||||||
OperationID string `json:"operationID" binding:"required"`
|
ParamsCommFriend
|
||||||
FromUserID string `json:"fromUserID" binding:"required"`
|
|
||||||
}
|
}
|
||||||
type UserIDResult struct {
|
type UserIDResult struct {
|
||||||
UserID string `json:"userID""`
|
UserID string `json:"userID""`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user