|
@@ -1,76 +0,0 @@
|
|
|
-package model
|
|
|
-
|
|
|
-import (
|
|
|
- "time"
|
|
|
-
|
|
|
- "go.mongodb.org/mongo-driver/bson/primitive"
|
|
|
-)
|
|
|
-
|
|
|
-// ImageFormat represents the image format information
|
|
|
-type ImageFormat struct {
|
|
|
- Ext string `bson:"ext,omitempty" json:"ext,omitempty"`
|
|
|
- URL string `bson:"url,omitempty" json:"url,omitempty"`
|
|
|
- Hash string `bson:"hash,omitempty" json:"hash,omitempty"`
|
|
|
- Mime string `bson:"mime,omitempty" json:"mime,omitempty"`
|
|
|
- Name string `bson:"name,omitempty" json:"name,omitempty"`
|
|
|
- Path *string `bson:"path,omitempty" json:"path,omitempty"`
|
|
|
- Size float64 `bson:"size,omitempty" json:"size,omitempty"`
|
|
|
- Width int `bson:"width,omitempty" json:"width,omitempty"`
|
|
|
- Height int `bson:"height,omitempty" json:"height,omitempty"`
|
|
|
- SizeInBytes int `bson:"size_in_bytes,omitempty" json:"sizeInBytes,omitempty"`
|
|
|
-}
|
|
|
-
|
|
|
-// Formats represents different sizes of image formats
|
|
|
-type Formats struct {
|
|
|
- Large *ImageFormat `bson:"large,omitempty" json:"large,omitempty"`
|
|
|
- Small *ImageFormat `bson:"small,omitempty" json:"small,omitempty"`
|
|
|
- Medium *ImageFormat `bson:"medium,omitempty" json:"medium,omitempty"`
|
|
|
- Thumbnail *ImageFormat `bson:"thumbnail,omitempty" json:"thumbnail,omitempty"`
|
|
|
-}
|
|
|
-
|
|
|
-// ImageAttributes represents the image attributes
|
|
|
-type ImageAttributes struct {
|
|
|
- Name string `bson:"name,omitempty" json:"name,omitempty"`
|
|
|
- AlternativeText *string `bson:"alternative_text,omitempty" json:"alternativeText,omitempty"`
|
|
|
- Caption *string `bson:"caption,omitempty" json:"caption,omitempty"`
|
|
|
- Width int `bson:"width,omitempty" json:"width,omitempty"`
|
|
|
- Height int `bson:"height,omitempty" json:"height,omitempty"`
|
|
|
- Formats Formats `bson:"formats,omitempty" json:"formats,omitempty"`
|
|
|
- Hash string `bson:"hash,omitempty" json:"hash,omitempty"`
|
|
|
- Ext string `bson:"ext,omitempty" json:"ext,omitempty"`
|
|
|
- Mime string `bson:"mime,omitempty" json:"mime,omitempty"`
|
|
|
- Size float64 `bson:"size,omitempty" json:"size,omitempty"`
|
|
|
- URL string `bson:"url,omitempty" json:"url,omitempty"`
|
|
|
- PreviewURL *string `bson:"preview_url,omitempty" json:"previewUrl,omitempty"`
|
|
|
- Provider string `bson:"provider,omitempty" json:"provider,omitempty"`
|
|
|
- ProviderMetadata *string `bson:"provider_metadata,omitempty" json:"provider_metadata,omitempty"`
|
|
|
- CreatedAt time.Time `bson:"created_at,omitempty" json:"createdAt,omitempty"`
|
|
|
- UpdatedAt time.Time `bson:"updated_at,omitempty" json:"updatedAt,omitempty"`
|
|
|
-}
|
|
|
-
|
|
|
-// ImageData represents the image data structure
|
|
|
-type ImageData struct {
|
|
|
- ID int `bson:"id,omitempty" json:"id,omitempty"`
|
|
|
- Attributes ImageAttributes `bson:"attributes,omitempty" json:"attributes,omitempty"`
|
|
|
-}
|
|
|
-
|
|
|
-// Image represents the image wrapper structure
|
|
|
-type Image struct {
|
|
|
- Data ImageData `bson:"data,omitempty" json:"data,omitempty"`
|
|
|
-}
|
|
|
-
|
|
|
-// Background represents the background material model that exactly matches the JSON structure
|
|
|
-type Material struct {
|
|
|
- Id primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
|
|
|
- Cid primitive.ObjectID `bson:"cid,omitempty" json:"cid,omitempty"`
|
|
|
- ID int `bson:"id,omitempty" json:"id,omitempty"`
|
|
|
- Type int `bson:"type,omitempty" json:"type,omitempty"`
|
|
|
- Attributes struct {
|
|
|
- Name string `bson:"name,omitempty" json:"name,omitempty"`
|
|
|
- Desc *string `bson:"desc,omitempty" json:"desc,omitempty"`
|
|
|
- CreatedAt time.Time `bson:"created_at,omitempty" json:"createdAt,omitempty"`
|
|
|
- UpdatedAt time.Time `bson:"updated_at,omitempty" json:"updatedAt,omitempty"`
|
|
|
- PublishedAt time.Time `bson:"published_at,omitempty" json:"publishedAt,omitempty"`
|
|
|
- Img Image `bson:"img,omitempty" json:"img,omitempty"`
|
|
|
- } `bson:"attributes,omitempty" json:"attributes,omitempty"`
|
|
|
-}
|