mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2026-11-17 22:58:07 +00:00
Feat: rename file
This commit is contained in:
1 parent
f4c414c0f6
commit
10a2ef4267
7 files changed
+83
-4
No files matched your search
@@ -141,3 +141,8 @@ func GetFilesByParentIDs(ids []uint, uid uint) ([]File, error) {
|
||||
result := DB.Where("user_id = ? and folder_id in (?)", uid, ids).Find(&files)
|
||||
return files, result.Error
|
||||
}
|
||||
|
||||
// Rename 重命名文件
|
||||
func (file *File) Rename(new string) error {
|
||||
return DB.Model(&file).Update("name", new).Error
|
||||
}
|
||||
Reference in new issue
Block a user