Modify: change raw object ID to Hash ID in share service

This commit is contained in:
HFO4
2020-02-10 14:29:27 +08:00
parent 9be1b4366f
commit 8f28a9c346
4 changed files with 45 additions and 26 deletions

View File

@@ -195,7 +195,7 @@ func (fs *FileSystem) doCompress(ctx context.Context, file *model.File, folder *
// Decompress 解压缩给定压缩文件到dst目录
func (fs *FileSystem) Decompress(ctx context.Context, src, dst string) error {
err := fs.resetFileIfNotExist(ctx, src)
err := fs.ResetFileIfNotExist(ctx, src)
if err != nil {
return err
}

View File

@@ -285,8 +285,8 @@ func (fs *FileSystem) signURL(ctx context.Context, file *model.File, ttl int64,
return source, nil
}
// resetFileIfNotExist 重设当前目标文件为 path如果当前目标为空
func (fs *FileSystem) resetFileIfNotExist(ctx context.Context, path string) error {
// ResetFileIfNotExist 重设当前目标文件为 path如果当前目标为空
func (fs *FileSystem) ResetFileIfNotExist(ctx context.Context, path string) error {
// 找到文件
if len(fs.FileTarget) == 0 {
exist, file := fs.IsFileExist(path)
@@ -300,7 +300,7 @@ func (fs *FileSystem) resetFileIfNotExist(ctx context.Context, path string) erro
return fs.resetPolicyToFirstFile(ctx)
}
// resetFileIfNotExist 重设当前目标文件为 id如果当前目标为空
// ResetFileIfNotExist 重设当前目标文件为 id如果当前目标为空
func (fs *FileSystem) resetFileIDIfNotExist(ctx context.Context, id uint) error {
// 找到文件
if len(fs.FileTarget) == 0 {