feat(aliyundrive_open): optional delete file directly (close #3769)
This commit is contained in:
parent
2379cb8d67
commit
5596661ce8
@ -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 {
|
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{
|
req.SetBody(base.Json{
|
||||||
"drive_id": d.DriveId,
|
"drive_id": d.DriveId,
|
||||||
"file_id": obj.GetID(),
|
"file_id": obj.GetID(),
|
||||||
|
@ -13,6 +13,7 @@ type Addition struct {
|
|||||||
OauthTokenURL string `json:"oauth_token_url" default:"https://api.nn.ci/alist/ali_open/token"`
|
OauthTokenURL string `json:"oauth_token_url" default:"https://api.nn.ci/alist/ali_open/token"`
|
||||||
ClientID string `json:"client_id" required:"false" help:"Keep it empty if you don't have one"`
|
ClientID string `json:"client_id" required:"false" help:"Keep it empty if you don't have one"`
|
||||||
ClientSecret string `json:"client_secret" required:"false" help:"Keep it empty if you don't have one"`
|
ClientSecret string `json:"client_secret" required:"false" help:"Keep it empty if you don't have one"`
|
||||||
|
RemoveWay string `json:"remove_way" required:"true" type:"select" options:"trash,delete"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var config = driver.Config{
|
var config = driver.Config{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user