(baseParams api.BaseParams, user *User)
| 34 | } |
| 35 | |
| 36 | func UpdateUser(baseParams api.BaseParams, user *User) error { |
| 37 | msg := cos.MustMarshal(user) |
| 38 | baseParams.Method = http.MethodPut |
| 39 | reqParams := api.AllocRp() |
| 40 | defer api.FreeRp(reqParams) |
| 41 | { |
| 42 | reqParams.BaseParams = baseParams |
| 43 | reqParams.Path = apc.URLPathUsers.Join(user.ID) |
| 44 | reqParams.Body = msg |
| 45 | reqParams.Header = http.Header{cos.HdrContentType: []string{cos.ContentJSON}} |
| 46 | } |
| 47 | return reqParams.DoHTTPRequest() |
| 48 | } |
| 49 | |
| 50 | func DeleteUser(baseParams api.BaseParams, userID string) error { |
| 51 | baseParams.Method = http.MethodDelete |
no test coverage detected