提交 95a771c2 编写于 作者: W wenxu12345

Refactor code

上级 cf59f57a
......@@ -54,7 +54,7 @@ func ImportFriend(c *gin.Context) {
return
}
req := &rpc.ImportFriendReq{}
utils.CopyStructFields(req, &params)
utils.CopyStructFields(req, &params.ParamsCommFriend)
var ok bool
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
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) {
log.NewInfo(req.OperationID, "ImportFriend failed ", req.String())
log.NewInfo(req.OperationID, "ImportFriend args ", req.String())
resp := pbFriend.ImportFriendResp{CommonResp: &pbFriend.CommonResp{}}
var c pbFriend.CommonResp
......
......@@ -17,8 +17,7 @@ type AddBlacklistResp struct {
type ImportFriendReq struct {
FriendUserIDList []string `json:"friendUserIDList" binding:"required"`
OperationID string `json:"operationID" binding:"required"`
FromUserID string `json:"fromUserID" binding:"required"`
ParamsCommFriend
}
type UserIDResult struct {
UserID string `json:"userID""`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册