提交 5c509ee8 编写于 作者: W wenxu12345

tidy code

上级 12ebf232
......@@ -6,6 +6,7 @@ import (
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
rpc "Open_IM/pkg/proto/user"
"Open_IM/pkg/utils"
"context"
......@@ -115,8 +116,8 @@ func UpdateUserInfo(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
req := &rpc.UpdateUserInfoReq{}
utils.CopyStructFields(req, &params)
req := &rpc.UpdateUserInfoReq{UserInfo: &open_im_sdk.UserInfo{}}
utils.CopyStructFields(req.UserInfo, &params)
var ok bool
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
if !ok {
......
......@@ -7,7 +7,7 @@ import (
type UserInfo struct {
UserID string `json:"userID" binding:"required,min=1,max=64"`
Nickname string `json:"nickname" binding:"required,min=1,max=64"`
Nickname string `json:"nickname" binding:"omitempty,min=1,max=64"`
FaceUrl string `json:"faceUrl" binding:"omitempty,max=1024"`
Gender int32 `json:"gender" binding:"omitempty,oneof=0 1 2"`
PhoneNumber string `json:"phoneNumber" binding:"omitempty,max=32"`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册