Feat: insert file record to database

This commit is contained in:
HFO4
2019-11-20 15:24:26 +08:00
parent e835dafc88
commit e09294d388
4 changed files with 35 additions and 4 deletions

View File

@@ -73,10 +73,12 @@ func GenericAfterUpload(ctx context.Context, fs *FileSystem) error {
}
// 向数据库中插入记录
err := fs.AddFile(&folder)
_, err := fs.AddFile(ctx, &folder)
if err != nil {
return errors.New("无法插入文件记录")
}
// 异步尝试生成缩略图
return nil
}