UPDATE: Media module
All checks were successful
Build and Release / release (push) Successful in 1m7s
All checks were successful
Build and Release / release (push) Successful in 1m7s
This commit is contained in:
@@ -17,6 +17,18 @@ type MediaEntity struct {
|
||||
UpdatedAt *time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type MediaStorageEntity struct {
|
||||
ID string `json:"id"`
|
||||
StorageKey string `json:"storage_key"`
|
||||
}
|
||||
|
||||
func (e * MediaEntity) ToStorageEntity() *MediaStorageEntity {
|
||||
return &MediaStorageEntity{
|
||||
ID: e.ID,
|
||||
StorageKey: e.StorageKey,
|
||||
}
|
||||
}
|
||||
|
||||
func (e *MediaEntity) ToResponse() *response.MediaResponse {
|
||||
return &response.MediaResponse{
|
||||
ID: e.ID,
|
||||
@@ -30,3 +42,11 @@ func (e *MediaEntity) ToResponse() *response.MediaResponse {
|
||||
UpdatedAt: e.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func MediaEntitiesToResponse(entities []*MediaEntity) []*response.MediaResponse {
|
||||
responses := make([]*response.MediaResponse, len(entities))
|
||||
for i, entity := range entities {
|
||||
responses[i] = entity.ToResponse()
|
||||
}
|
||||
return responses
|
||||
}
|
||||
|
||||
@@ -8,6 +8,16 @@ type TokenEntity struct {
|
||||
TokenType constants.TokenType `json:"token_type"`
|
||||
}
|
||||
|
||||
type TokenUploadEntity struct {
|
||||
ID string `json:"id"`
|
||||
UserID string `json:"user_id"`
|
||||
StorageKey string `json:"storage_key"`
|
||||
OriginalName string `json:"original_name"`
|
||||
MimeType string `json:"mime_type"`
|
||||
Size int64 `json:"size"`
|
||||
FileMetadata []byte `json:"file_metadata"`
|
||||
}
|
||||
|
||||
type OAuthState struct {
|
||||
State string `json:"state"`
|
||||
RedirectURL string `json:"redirect"`
|
||||
|
||||
Reference in New Issue
Block a user