Calculate md5 checksum when finishing uploading.

This commit is contained in:
nyne
2025-05-16 18:16:19 +08:00
parent 4d03955703
commit 271cde9e1e
6 changed files with 53 additions and 53 deletions

View File

@@ -21,7 +21,6 @@ type UploadingFile struct {
TempPath string
Resource Resource `gorm:"foreignKey:TargetResourceID"`
Storage Storage `gorm:"foreignKey:TargetStorageID"`
Md5 string
}
func (uf *UploadingFile) BlocksCount() int {
@@ -86,7 +85,6 @@ type UploadingFileView struct {
BlocksCount int `json:"blocksCount"`
StorageID uint `json:"storageId"`
ResourceID uint `json:"resourceId"`
Md5 string `json:"md5"`
}
func (uf *UploadingFile) ToView() *UploadingFileView {
@@ -99,6 +97,5 @@ func (uf *UploadingFile) ToView() *UploadingFileView {
BlocksCount: uf.BlocksCount(),
StorageID: uf.TargetStorageID,
ResourceID: uf.TargetResourceID,
Md5: uf.Md5,
}
}