mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Calculate md5 checksum when finishing uploading.
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user