From 362c65555c5a81a40cf5bf993e915e001adf782a Mon Sep 17 00:00:00 2001 From: songjc <969378911@qq.com> Date: Wed, 9 Aug 2023 16:46:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/services/storage.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/services/storage.go b/internal/services/storage.go index dba21b3..d0b5e85 100644 --- a/internal/services/storage.go +++ b/internal/services/storage.go @@ -101,6 +101,7 @@ func (svc *Service) PreMoveObjectToStorage(msg *coormsg.PreMoveObjectToStorage) } func (svc *Service) MoveObjectToStorage(msg *coormsg.MoveObjectToStorage) (*coormsg.MoveObjectToStorageResp, *ramsg.CodeMessage) { + // TODO: 对于的storage中已经存在的文件,直接覆盖已有文件 err := svc.db.DoTx(sql.LevelDefault, func(tx *sqlx.Tx) error { return svc.db.StorageObject().MoveObjectTo(tx, msg.ObjectID, msg.StorageID, msg.UserID) }) From edffc4c68bca1c2fd0d568b6a2ce1b78fd337cd1 Mon Sep 17 00:00:00 2001 From: songjc <969378911@qq.com> Date: Thu, 10 Aug 2023 15:17:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/services/storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/storage.go b/internal/services/storage.go index 757bec6..f5bc8c9 100644 --- a/internal/services/storage.go +++ b/internal/services/storage.go @@ -61,7 +61,7 @@ func (svc *Service) PreMoveObjectToStorage(msg *coormsg.PreMoveObjectToStorage) return ramsg.ReplyOK(coormsg.NewPreMoveObjectToStorageRespBody( stg.NodeID, stg.Directory, - object.FileSize, + object, models.NewRedundancyRepData(objectRep.FileHash), ))