Merge pull request #204 from Rain-kl/feat/save-strategy

新增功能: 重名文件时选择保存策略 - 重命名,覆盖,跳过
This commit is contained in:
Ryan
2026-05-20 16:11:00 +08:00
committed by GitHub
parent 0982abe7bc
commit 62e4a08e28
20 changed files with 441 additions and 48 deletions

View File

@@ -14,6 +14,31 @@ const (
TypeCancel = "cancel"
)
const (
ConflictStrategyRename = "rename"
ConflictStrategyAsk = "ask"
ConflictStrategyOverwrite = "overwrite"
ConflictStrategySkip = "skip"
)
func ConflictStrategyValues() []string {
return []string{
ConflictStrategyRename,
ConflictStrategyAsk,
ConflictStrategyOverwrite,
ConflictStrategySkip,
}
}
func IsConflictStrategy(strategy string) bool {
for _, value := range ConflictStrategyValues() {
if strategy == value {
return true
}
}
return false
}
// type TaskDataTGFiles struct {
// Files []tfile.TGFileMessage
// AsBatch bool
@@ -34,6 +59,8 @@ type Add struct {
SelectedStorName string
DirID uint
SettedDir bool
SelectedDirPath string
ConflictStrategy string
// tfiles
Files []tfile.TGFileMessage
AsBatch bool