🎨 change link interface

This commit is contained in:
微凉
2021-12-19 20:00:53 +08:00
parent f5b8815a84
commit d00f75c814
14 changed files with 96 additions and 73 deletions

View File

@ -30,7 +30,7 @@ func Down(c *gin.Context) {
Proxy(c)
return
}
link, err := driver.Link(path, account)
link, err := driver.Link(base.Args{Path: path}, account)
if err != nil {
common.ErrorResp(c, err, 500)
return
@ -71,7 +71,7 @@ func Proxy(c *gin.Context) {
c.Redirect(302, link)
return
}
link, err := driver.Link(path, account)
link, err := driver.Link(base.Args{Path: path}, account)
if err != nil {
common.ErrorResp(c, err, 500)
return

View File

@ -94,7 +94,7 @@ func Link(c *gin.Context) {
})
return
}
link, err := driver.Link(path, account)
link, err := driver.Link(base.Args{Path: path}, account)
if err != nil {
common.ErrorResp(c, err, 500)
return

View File

@ -123,7 +123,7 @@ func (fs *FileSystem) Link(r *http.Request, rawPath string) (string, error) {
link += "?sign" + sign
}
} else {
link_, err := driver.Link(path_, account)
link_, err := driver.Link(base.Args{Path: path_}, account)
if err != nil {
return "", err
}
@ -145,7 +145,7 @@ func (fs *FileSystem) CreateDirectory(ctx context.Context, rawPath string) error
if err != nil {
return err
}
return driver.MakeDir(path_,account)
return driver.MakeDir(path_, account)
}
func (fs *FileSystem) Upload(ctx context.Context, r *http.Request, rawPath string) error {
@ -218,7 +218,7 @@ func moveFiles(ctx context.Context, fs *FileSystem, src string, dst string, over
if srcAccount.Name != dstAccount.Name {
return http.StatusMethodNotAllowed, errInvalidDestination
}
err = driver.Move(srcPath,dstPath,srcAccount)
err = driver.Move(srcPath, dstPath, srcAccount)
if err != nil {
log.Debug(err)
return http.StatusInternalServerError, err
@ -248,7 +248,7 @@ func copyFiles(ctx context.Context, fs *FileSystem, src string, dst string, over
// TODO 跨账号复制
return http.StatusMethodNotAllowed, errInvalidDestination
}
err = driver.Copy(srcPath,dstPath,srcAccount)
err = driver.Copy(srcPath, dstPath, srcAccount)
if err != nil {
return http.StatusInternalServerError, err
}