mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
i18n: objects / share / slave / tag operations
This commit is contained in:
@@ -22,4 +22,5 @@ var (
|
||||
ErrIO = serializer.NewError(serializer.CodeIOFailed, "Failed to read file data", nil)
|
||||
ErrDBListObjects = serializer.NewError(serializer.CodeDBError, "Failed to list object records", nil)
|
||||
ErrDBDeleteObjects = serializer.NewError(serializer.CodeDBError, "Failed to delete object records", nil)
|
||||
ErrOneObjectOnly = serializer.ParamErr("You can only copy one object at the same time", nil)
|
||||
)
|
||||
|
||||
@@ -73,7 +73,7 @@ func (fs *FileSystem) Copy(ctx context.Context, dirs, files []uint, src, dst str
|
||||
if len(dirs) > 0 {
|
||||
subFileSizes, err := srcFolder.CopyFolderTo(dirs[0], dstFolder)
|
||||
if err != nil {
|
||||
return serializer.NewError(serializer.CodeDBError, "操作失败,可能有重名冲突", err)
|
||||
return ErrObjectNotExist.WithError(err)
|
||||
}
|
||||
newUsedStorage += subFileSizes
|
||||
}
|
||||
@@ -82,7 +82,7 @@ func (fs *FileSystem) Copy(ctx context.Context, dirs, files []uint, src, dst str
|
||||
if len(files) > 0 {
|
||||
subFileSizes, err := srcFolder.MoveOrCopyFileTo(files, dstFolder, true)
|
||||
if err != nil {
|
||||
return serializer.NewError(serializer.CodeDBError, "操作失败,可能有重名冲突", err)
|
||||
return ErrObjectNotExist.WithError(err)
|
||||
}
|
||||
newUsedStorage += subFileSizes
|
||||
}
|
||||
@@ -106,13 +106,13 @@ func (fs *FileSystem) Move(ctx context.Context, dirs, files []uint, src, dst str
|
||||
// 处理目录及子文件移动
|
||||
err := srcFolder.MoveFolderTo(dirs, dstFolder)
|
||||
if err != nil {
|
||||
return serializer.NewError(serializer.CodeDBError, "操作失败,可能有重名冲突", err)
|
||||
return ErrFileExisted.WithError(err)
|
||||
}
|
||||
|
||||
// 处理文件移动
|
||||
_, err = srcFolder.MoveOrCopyFileTo(files, dstFolder, false)
|
||||
if err != nil {
|
||||
return serializer.NewError(serializer.CodeDBError, "操作失败,可能有重名冲突", err)
|
||||
return ErrFileExisted.WithError(err)
|
||||
}
|
||||
|
||||
// 移动文件
|
||||
|
||||
@@ -164,6 +164,14 @@ const (
|
||||
CodeUnsupportedArchiveType = 40056
|
||||
// 可用存储策略发生变化
|
||||
CodePolicyChanged = 40057
|
||||
// 分享链接无效
|
||||
CodeShareLinkNotFound = 40058
|
||||
// 不能转存自己的分享
|
||||
CodeSaveOwnShare = 40059
|
||||
// 从机无法向主机发送回调请求
|
||||
CodeSlavePingMaster = 40060
|
||||
// Cloudreve 版本不一致
|
||||
CodeVersionMismatch = 40061
|
||||
// CodeDBError 数据库操作失败
|
||||
CodeDBError = 50001
|
||||
// CodeEncryptError 加密失败
|
||||
|
||||
Reference in New Issue
Block a user