refactor: add UploadID to UploadMetadata

This commit is contained in:
Derrick Hammer 2024-03-03 06:09:31 -05:00
parent ecf2532974
commit 82ae0d3ef7
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 3 deletions

View File

@ -14,11 +14,12 @@ import (
var ErrNotFound = gorm.ErrRecordNotFound
type UploadMetadata struct {
UserID uint `json:"userId"`
ID uint `json:"upload_id"`
UserID uint `json:"user_id"`
Hash []byte `json:"hash"`
MimeType string `json:"mimeType"`
MimeType string `json:"mime_type"`
Protocol string `json:"protocol"`
UploaderIP string `json:"uploaderIp"`
UploaderIP string `json:"uploader_ip"`
Size uint64 `json:"size"`
Created time.Time `json:"created"`
}
@ -137,6 +138,7 @@ func (m *MetadataServiceDefault) GetUpload(ctx context.Context, objectHash []byt
}
return UploadMetadata{
ID: upload.ID,
UserID: upload.UserID,
Hash: upload.Hash,
MimeType: upload.MimeType,