MCPcopy Create free account
hub / github.com/dearcode/candy / UpdateUserInfo

Method UpdateUserInfo

client/candy.go:130–146  ·  view source on GitHub ↗

UpdateUserInfo 更新用户信息, 昵称/头像

(user, nickName string, avatar []byte)

Source from the content-addressed store, hash-verified

128
129// UpdateUserInfo 更新用户信息, 昵称/头像
130func (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 更新用户密码
149func (c *CandyClient) UpdateUserPassword(user, passwd string) (int64, error) {

Callers

nothing calls this directly

Calls 5

CheckUserNameFunction · 0.85
NewErrorFunction · 0.85
CheckNickNameFunction · 0.85
UpdateUserInfoMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected