作者 yangfu

用户基础数据修改

@@ -117,8 +117,8 @@ func (srv UserService) UpdateUserBaseInfo(updateUserInfoCommand *command.UpdateU @@ -117,8 +117,8 @@ func (srv UserService) UpdateUserBaseInfo(updateUserInfoCommand *command.UpdateU
117 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 117 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
118 } 118 }
119 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{}) 119 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
120 - user, err := creationUserGateway.UserGet(allied_creation_user.ReqGetUser{  
121 - UserId: int(updateUserInfoCommand.Operator.UserId), 120 + user, err := creationUserGateway.AuthUserBaseInfo(allied_creation_user.ReqAuthUserBase{
  121 + Account: updateUserInfoCommand.Operator.Phone,
122 }) 122 })
123 if err != nil { 123 if err != nil {
124 return nil, application.ThrowError(application.BUSINESS_ERROR, "用户不存在") 124 return nil, application.ThrowError(application.BUSINESS_ERROR, "用户不存在")
@@ -143,11 +143,11 @@ func (srv UserService) UpdateUserBaseInfo(updateUserInfoCommand *command.UpdateU @@ -143,11 +143,11 @@ func (srv UserService) UpdateUserBaseInfo(updateUserInfoCommand *command.UpdateU
143 } 143 }
144 } 144 }
145 _, err = creationUserGateway.UserUpdateBaseInfo(allied_creation_user.ReqUserUpdateBaseInfo{ 145 _, err = creationUserGateway.UserUpdateBaseInfo(allied_creation_user.ReqUserUpdateBaseInfo{
146 - UserId: int64(user.UserId),  
147 - UserName: updateUserInfoCommand.UserName,  
148 - Avatar: updateUserInfoCommand.Avatar,  
149 - Phone: updateUserInfoCommand.Phone,  
150 - Email: updateUserInfoCommand.Email, 146 + UserBaseId: int64(user.UserBaseID),
  147 + UserName: updateUserInfoCommand.UserName,
  148 + Avatar: updateUserInfoCommand.Avatar,
  149 + Phone: updateUserInfoCommand.Phone,
  150 + Email: updateUserInfoCommand.Email,
151 }) 151 })
152 if err != nil { 152 if err != nil {
153 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 153 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -303,6 +303,8 @@ type ( @@ -303,6 +303,8 @@ type (
303 type ( 303 type (
304 ReqUserUpdateBaseInfo struct { 304 ReqUserUpdateBaseInfo struct {
305 UserId int64 `json:"userId"` 305 UserId int64 `json:"userId"`
  306 + // 用户基础Id 用户唯一标识
  307 + UserBaseId int64 `cname:"用户Id 用户唯一标识" json:"userBaseId" valid:"Required"`
306 // 用户姓名 308 // 用户姓名
307 UserName string `cname:"用户姓名" json:"userName" valid:"Required"` 309 UserName string `cname:"用户姓名" json:"userName" valid:"Required"`
308 // 头像 310 // 头像