feat(files/sharing): refactor sharing apis with tests

This commit is contained in:
hexxa 2021-08-18 11:12:24 +08:00 committed by Hexxa
parent 5ef94afd7a
commit 80d54f42a1
5 changed files with 67 additions and 16 deletions

View file

@ -179,7 +179,14 @@ func (cl *FilesClient) AddSharing(dirpath string) (*http.Response, string, []err
func (cl *FilesClient) DelSharing(dirpath string) (*http.Response, string, []error) {
return cl.r.Delete(cl.url("/v1/fs/sharings")).
AddCookie(cl.token).
Send(fileshdr.SharingReq{SharingPath: dirpath}).
Param(fileshdr.FilePathQuery, dirpath).
End()
}
func (cl *FilesClient) IsSharing(dirpath string) (*http.Response, string, []error) {
return cl.r.Get(cl.url("/v1/fs/sharings/exist")).
AddCookie(cl.token).
Param(fileshdr.FilePathQuery, dirpath).
End()
}