UpdateUserInfo 更新用户信息, 昵称/头像
(user, nickName string, avatar []byte)
| 128 | |
| 129 | // UpdateUserInfo 更新用户信息, 昵称/头像 |
| 130 | func (c *CandyClient) UpdateUserInfo(user, nickName string, avatar []byte) (int64, error) { |
| 131 | if code, err := CheckUserName(user); err != nil { |
| 132 | return -1, NewError(code, err.Error()) |
| 133 | } |
| 134 | |
| 135 | if code, err := CheckNickName(nickName); err != nil { |
| 136 | return -1, NewError(code, err.Error()) |
| 137 | } |
| 138 | |
| 139 | req := &meta.GateUpdateUserInfoRequest{User: user, NickName: nickName, Avatar: avatar} |
| 140 | resp, err := c.api.UpdateUserInfo(context.Background(), req) |
| 141 | if err != nil { |
| 142 | return -1, err |
| 143 | } |
| 144 | |
| 145 | return resp.ID, resp.Header.Error() |
| 146 | } |
| 147 | |
| 148 | // UpdateUserPassword 更新用户密码 |
| 149 | func (c *CandyClient) UpdateUserPassword(user, passwd string) (int64, error) { |
nothing calls this directly
no test coverage detected