From 04e509fc49e67a6dd60aa098934c7a3377cc9b6b Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 19 Jan 2022 18:14:53 +0800 Subject: [PATCH] update user --- internal/api/user/user.go | 1 + pkg/base_info/auth_api_struct.go | 2 +- pkg/base_info/public_struct.go | 6 +++--- pkg/base_info/user_api_struct.go | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/api/user/user.go b/internal/api/user/user.go index 8508cddc8..e42f0d1b8 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -63,6 +63,7 @@ func UpdateUserInfo(c *gin.Context) { } req := &rpc.UpdateUserInfoReq{UserInfo: &open_im_sdk.UserInfo{}} utils.CopyStructFields(req.UserInfo, ¶ms) + req.OperationID = params.OperationID var ok bool ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) diff --git a/pkg/base_info/auth_api_struct.go b/pkg/base_info/auth_api_struct.go index a4db08f84..13d6e140b 100644 --- a/pkg/base_info/auth_api_struct.go +++ b/pkg/base_info/auth_api_struct.go @@ -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"` } diff --git a/pkg/base_info/public_struct.go b/pkg/base_info/public_struct.go index dbb729e71..1e60ae294 100644 --- a/pkg/base_info/public_struct.go +++ b/pkg/base_info/public_struct.go @@ -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"` } diff --git a/pkg/base_info/user_api_struct.go b/pkg/base_info/user_api_struct.go index 2ccfc6cc6..f4be785f2 100644 --- a/pkg/base_info/user_api_struct.go +++ b/pkg/base_info/user_api_struct.go @@ -15,7 +15,7 @@ type GetUsersInfoResp struct { } type UpdateSelfUserInfoReq struct { - UserInfo + ApiUserInfo OperationID string `json:"operationID" binding:"required"` }