feat(aliyundrive_open): optional delete file directly (close #3769)

This commit is contained in:
Andy Hsu
2023-03-08 19:19:13 +08:00
parent 2379cb8d67
commit 5596661ce8
2 changed files with 6 additions and 1 deletions

View File

@ -125,7 +125,11 @@ func (d *AliyundriveOpen) Copy(ctx context.Context, srcObj, dstDir model.Obj) er
}
func (d *AliyundriveOpen) Remove(ctx context.Context, obj model.Obj) error {
_, err := d.request("/adrive/v1.0/openFile/recyclebin/trash", http.MethodPost, func(req *resty.Request) {
uri := "/adrive/v1.0/openFile/recyclebin/trash"
if d.RemoveWay == "delete" {
uri = "/adrive/v1.0/openFile/delete"
}
_, err := d.request(uri, http.MethodPost, func(req *resty.Request) {
req.SetBody(base.Json{
"drive_id": d.DriveId,
"file_id": obj.GetID(),