🎨 Optimize code structure

This commit is contained in:
微凉
2022-01-03 20:06:36 +08:00
parent e7ba289d06
commit 7cf30836bf
18 changed files with 269 additions and 342 deletions

View File

@ -3,6 +3,7 @@ package controllers
import (
"errors"
"github.com/Xhofe/alist/conf"
"github.com/Xhofe/alist/drivers/operate"
"github.com/Xhofe/alist/model"
"github.com/Xhofe/alist/server/common"
"github.com/Xhofe/alist/utils"
@ -48,7 +49,7 @@ func UploadFile(c *gin.Context) {
Name: file.Filename,
MIMEType: file.Header.Get("Content-Type"),
}
err = driver.Upload(&fileStream, account)
err = operate.Upload(driver, account, &fileStream, true)
if err != nil {
common.ErrorResp(c, err, 500)
return