From 92a0453e00f1659a6cfee845e0e073ff915b3a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=87=89?= <927625802@qq.com> Date: Thu, 16 Dec 2021 15:44:18 +0800 Subject: [PATCH] :art: change internal type --- drivers/lanzou/driver.go | 6 +++--- drivers/lanzou/lanzou.go | 2 +- drivers/onedrive/driver.go | 2 +- drivers/onedrive/onedrive.go | 2 +- model/account.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/lanzou/driver.go b/drivers/lanzou/driver.go index 252893e3..e9e62b9f 100644 --- a/drivers/lanzou/driver.go +++ b/drivers/lanzou/driver.go @@ -22,7 +22,7 @@ func (driver Lanzou) Config() base.DriverConfig { func (driver Lanzou) Items() []base.Item { return []base.Item{ { - Name: "onedrive_type", + Name: "internal_type", Label: "lanzou type", Type: base.TypeSelect, Required: true, @@ -53,7 +53,7 @@ func (driver Lanzou) Items() []base.Item { } func (driver Lanzou) Save(account *model.Account, old *model.Account) error { - if account.OnedriveType == "cookie" { + if account.InternalType == "cookie" { if account.RootFolder == "" { account.RootFolder = "-1" } @@ -121,7 +121,7 @@ func (driver Lanzou) Link(path string, account *model.Account) (*base.Link, erro } log.Debugf("down file: %+v", file) downId := file.Id - if account.OnedriveType == "cookie" { + if account.InternalType == "cookie" { downId, err = driver.GetDownPageId(file.Id, account) if err != nil { return nil, err diff --git a/drivers/lanzou/lanzou.go b/drivers/lanzou/lanzou.go index aaa80d22..145b9239 100644 --- a/drivers/lanzou/lanzou.go +++ b/drivers/lanzou/lanzou.go @@ -53,7 +53,7 @@ type LanZouFilesResp struct { } func (driver *Lanzou) GetFiles(folderId string, account *model.Account) ([]LanZouFile, error) { - if account.OnedriveType == "cookie" { + if account.InternalType == "cookie" { files := make([]LanZouFile, 0) var resp LanZouFilesResp // folders diff --git a/drivers/onedrive/driver.go b/drivers/onedrive/driver.go index 27209844..e36518a3 100644 --- a/drivers/onedrive/driver.go +++ b/drivers/onedrive/driver.go @@ -33,7 +33,7 @@ func (driver Onedrive) Items() []base.Item { Description: "", }, { - Name: "onedrive_type", + Name: "internal_type", Label: "onedrive type", Type: base.TypeSelect, Required: true, diff --git a/drivers/onedrive/onedrive.go b/drivers/onedrive/onedrive.go index 722c423d..5c720def 100644 --- a/drivers/onedrive/onedrive.go +++ b/drivers/onedrive/onedrive.go @@ -46,7 +46,7 @@ func (driver Onedrive) GetMetaUrl(account *model.Account, auth bool, path string if auth { return host.Oauth } - switch account.OnedriveType { + switch account.InternalType { case "onedrive": { if path == "/" || path == "\\" { diff --git a/model/account.go b/model/account.go index afdd881f..96e7cabc 100644 --- a/model/account.go +++ b/model/account.go @@ -30,7 +30,7 @@ type Account struct { RedirectUri string `json:"redirect_uri"` SiteUrl string `json:"site_url"` SiteId string `json:"site_id"` - OnedriveType string `json:"onedrive_type"` + InternalType string `json:"internal_type"` WebdavProxy bool `json:"webdav_proxy"` Proxy bool `json:"proxy"` // 是否中转 //AllowProxy bool `json:"allow_proxy"` // 是否允许中转下载