mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Test: file compress / download
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"github.com/HFO4/cloudreve/pkg/util"
|
||||
"github.com/jinzhu/gorm"
|
||||
"path"
|
||||
@@ -25,6 +26,11 @@ type File struct {
|
||||
Position string `gorm:"-"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
// 注册缓存用到的复杂结构
|
||||
gob.Register(File{})
|
||||
}
|
||||
|
||||
// Create 创建文件记录
|
||||
func (file *File) Create() (uint, error) {
|
||||
if err := DB.Create(file).Error; err != nil {
|
||||
|
||||
Reference in New Issue
Block a user