Modify: re-organize structure of filesystem

This commit is contained in:
HFO4
2019-11-20 15:53:00 +08:00
parent e09294d388
commit 438ce02420
8 changed files with 191 additions and 142 deletions

View File

@@ -1,6 +1,9 @@
package model
import "github.com/jinzhu/gorm"
import (
"github.com/HFO4/cloudreve/pkg/util"
"github.com/jinzhu/gorm"
)
// File 文件
type File struct {
@@ -19,6 +22,7 @@ type File struct {
// Create 创建文件记录
func (file *File) Create() (uint, error) {
if err := DB.Create(file).Error; err != nil {
util.Log().Warning("无法插入文件记录, %s", err)
return 0, err
}
return file.ID, nil