From 82ae0d3ef7f851fd50d5c35700fd639dc9a9a369 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 3 Mar 2024 06:09:31 -0500 Subject: [PATCH] refactor: add UploadID to UploadMetadata --- metadata/metadata.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/metadata/metadata.go b/metadata/metadata.go index 6904cfa..6d23264 100644 --- a/metadata/metadata.go +++ b/metadata/metadata.go @@ -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,