🎨 add types

pull/548/head
微凉 2021-11-30 18:53:37 +08:00
parent fa6c0f78bc
commit 9dcaa9b07a
7 changed files with 13 additions and 6 deletions

View File

@ -186,7 +186,7 @@ func (driver Pan123) Proxy(c *gin.Context, account *model.Account) {
} }
func (driver Pan123) Preview(path string, account *model.Account) (interface{}, error) { func (driver Pan123) Preview(path string, account *model.Account) (interface{}, error) {
return nil, nil return nil, NotSupport
} }
var _ Driver = (*Pan123)(nil) var _ Driver = (*Pan123)(nil)

View File

@ -194,7 +194,7 @@ func (driver Cloud189) Proxy(ctx *gin.Context, account *model.Account) {
} }
func (driver Cloud189) Preview(path string, account *model.Account) (interface{}, error) { func (driver Cloud189) Preview(path string, account *model.Account) (interface{}, error) {
return nil, nil return nil, NotSupport
} }
var _ Driver = (*Cloud189)(nil) var _ Driver = (*Cloud189)(nil)

View File

@ -233,7 +233,7 @@ func (driver AliDrive) Preview(path string, account *model.Account) (interface{}
req["category"] = "live_transcoding" req["category"] = "live_transcoding"
} }
default: default:
return nil, fmt.Errorf("don't support") return nil, NotSupport
} }
_, err = aliClient.R().SetResult(&resp).SetError(&e). _, err = aliClient.R().SetResult(&resp).SetError(&e).
SetHeader("authorization", "Bearer\t"+account.AccessToken). SetHeader("authorization", "Bearer\t"+account.AccessToken).

View File

@ -162,7 +162,7 @@ func (driver GoogleDrive) Proxy(c *gin.Context, account *model.Account) {
} }
func (driver GoogleDrive) Preview(path string, account *model.Account) (interface{}, error) { func (driver GoogleDrive) Preview(path string, account *model.Account) (interface{}, error) {
return nil, nil return nil, NotSupport
} }
var _ Driver = (*GoogleDrive)(nil) var _ Driver = (*GoogleDrive)(nil)

View File

@ -155,7 +155,7 @@ func (driver Native) Proxy(c *gin.Context, account *model.Account) {
} }
func (driver Native) Preview(path string, account *model.Account) (interface{}, error) { func (driver Native) Preview(path string, account *model.Account) (interface{}, error) {
return nil, fmt.Errorf("no need") return nil, NotSupport
} }
var _ Driver = (*Native)(nil) var _ Driver = (*Native)(nil)

View File

@ -202,7 +202,7 @@ func (driver Onedrive) Proxy(c *gin.Context, account *model.Account) {
} }
func (driver Onedrive) Preview(path string, account *model.Account) (interface{}, error) { func (driver Onedrive) Preview(path string, account *model.Account) (interface{}, error) {
return nil, nil return nil, NotSupport
} }
var _ Driver = (*Onedrive)(nil) var _ Driver = (*Onedrive)(nil)

View File

@ -6,4 +6,11 @@ var (
PathNotFound = fmt.Errorf("path not found") PathNotFound = fmt.Errorf("path not found")
NotFile = fmt.Errorf("not file") NotFile = fmt.Errorf("not file")
NotImplement = fmt.Errorf("not implement") NotImplement = fmt.Errorf("not implement")
NotSupport = fmt.Errorf("not support")
)
const (
STRING = "string"
SELECT = "select"
BOOL = "bool"
) )