update user

pull/131/head
Gordon 3 years ago
parent d2b411ecbb
commit 04e509fc49

@ -63,6 +63,7 @@ func UpdateUserInfo(c *gin.Context) {
}
req := &rpc.UpdateUserInfoReq{UserInfo: &open_im_sdk.UserInfo{}}
utils.CopyStructFields(req.UserInfo, &params)
req.OperationID = params.OperationID
var ok bool
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))

@ -12,7 +12,7 @@ package base_info
type UserRegisterReq struct {
Secret string `json:"secret" binding:"required,max=32"`
Platform int32 `json:"platform" binding:"required,min=1,max=7"`
UserInfo
ApiUserInfo
OperationID string `json:"operationID" binding:"required"`
}

@ -5,13 +5,13 @@ import (
"net/http"
)
type UserInfo struct {
type ApiUserInfo struct {
UserID string `json:"userID" binding:"required,min=1,max=64"`
Nickname string `json:"nickname" binding:"omitempty,min=1,max=64"`
FaceUrl string `json:"faceUrl" binding:"omitempty,max=1024"`
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"`
Birth int64 `json:"birth" binding:"omitempty"`
Birth uint32 `json:"birth" binding:"omitempty"`
Email string `json:"email" binding:"omitempty,max=64"`
Ex string `json:"ex" binding:"omitempty,max=1024"`
}

@ -15,7 +15,7 @@ type GetUsersInfoResp struct {
}
type UpdateSelfUserInfoReq struct {
UserInfo
ApiUserInfo
OperationID string `json:"operationID" binding:"required"`
}

Loading…
Cancel
Save