UPDATE: Fix some bug
All checks were successful
Build and Release / release (push) Successful in 1m6s
All checks were successful
Build and Release / release (push) Successful in 1m6s
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
package response
|
package response
|
||||||
|
|
||||||
import "time"
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
type PreSignedResponse struct {
|
type PreSignedResponse struct {
|
||||||
TokenID string `json:"token_id"`
|
TokenID string `json:"token_id"`
|
||||||
@@ -16,7 +19,7 @@ type MediaResponse struct {
|
|||||||
OriginalName string `json:"original_name"`
|
OriginalName string `json:"original_name"`
|
||||||
MimeType string `json:"mime_type"`
|
MimeType string `json:"mime_type"`
|
||||||
Size int64 `json:"size"`
|
Size int64 `json:"size"`
|
||||||
FileMetadata []byte `json:"file_metadata"`
|
FileMetadata json.RawMessage `json:"file_metadata"`
|
||||||
CreatedAt *time.Time `json:"created_at"`
|
CreatedAt *time.Time `json:"created_at"`
|
||||||
UpdatedAt *time.Time `json:"updated_at"`
|
UpdatedAt *time.Time `json:"updated_at"`
|
||||||
}
|
}
|
||||||
@@ -27,6 +30,6 @@ type MediaSimpleResponse struct {
|
|||||||
OriginalName string `json:"original_name"`
|
OriginalName string `json:"original_name"`
|
||||||
MimeType string `json:"mime_type"`
|
MimeType string `json:"mime_type"`
|
||||||
Size int64 `json:"size"`
|
Size int64 `json:"size"`
|
||||||
FileMetadata []byte `json:"file_metadata"`
|
FileMetadata json.RawMessage `json:"file_metadata"`
|
||||||
CreatedAt *time.Time `json:"created_at"`
|
CreatedAt *time.Time `json:"created_at"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"history-api/internal/dtos/response"
|
"history-api/internal/dtos/response"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -12,7 +13,7 @@ type MediaEntity struct {
|
|||||||
OriginalName string `json:"original_name"`
|
OriginalName string `json:"original_name"`
|
||||||
MimeType string `json:"mime_type"`
|
MimeType string `json:"mime_type"`
|
||||||
Size int64 `json:"size"`
|
Size int64 `json:"size"`
|
||||||
FileMetadata []byte `json:"file_metadata"`
|
FileMetadata json.RawMessage `json:"file_metadata"`
|
||||||
CreatedAt *time.Time `json:"created_at"`
|
CreatedAt *time.Time `json:"created_at"`
|
||||||
UpdatedAt *time.Time `json:"updated_at"`
|
UpdatedAt *time.Time `json:"updated_at"`
|
||||||
}
|
}
|
||||||
@@ -22,11 +23,10 @@ type MediaSimpleEntity struct {
|
|||||||
OriginalName string `json:"original_name"`
|
OriginalName string `json:"original_name"`
|
||||||
MimeType string `json:"mime_type"`
|
MimeType string `json:"mime_type"`
|
||||||
Size int64 `json:"size"`
|
Size int64 `json:"size"`
|
||||||
FileMetadata []byte `json:"file_metadata"`
|
FileMetadata json.RawMessage `json:"file_metadata"`
|
||||||
CreatedAt *time.Time `json:"created_at"`
|
CreatedAt *time.Time `json:"created_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type MediaStorageEntity struct {
|
type MediaStorageEntity struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
StorageKey string `json:"storage_key"`
|
StorageKey string `json:"storage_key"`
|
||||||
@@ -73,7 +73,6 @@ func MediaEntitiesToResponse(entities []*MediaEntity) []*response.MediaResponse
|
|||||||
return responses
|
return responses
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func MediaEntitiesToStorageEntity(entities []*MediaEntity) []*MediaStorageEntity {
|
func MediaEntitiesToStorageEntity(entities []*MediaEntity) []*MediaStorageEntity {
|
||||||
responses := make([]*MediaStorageEntity, len(entities))
|
responses := make([]*MediaStorageEntity, len(entities))
|
||||||
for i, entity := range entities {
|
for i, entity := range entities {
|
||||||
|
|||||||
Reference in New Issue
Block a user