This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"kontor-api-gin/internal/helpers"
|
||||
"time"
|
||||
)
|
||||
|
||||
type MediaFile struct {
|
||||
ID string `gorm:"type:string;primary_key;" json:"id"`
|
||||
@@ -24,18 +27,18 @@ func (media_file *MediaFile) TableName() string {
|
||||
}
|
||||
|
||||
type MediaFileDTO struct {
|
||||
ID string `json:"id" binding:"required"`
|
||||
CreatedAt time.Time `json:"created_date"`
|
||||
UpdatedAt time.Time `json:"last_modified_date"`
|
||||
DeletedAt *time.Time `json:"deleted_date"`
|
||||
Version int `json:"version"`
|
||||
CloudLink string `json:"cloud_link"`
|
||||
FileName string `json:"file_name"`
|
||||
Path string `json:"path"`
|
||||
Review bool `json:"review"`
|
||||
Title string `json:"title"`
|
||||
WebLink string `json:"url"`
|
||||
ShouldDownload bool `json:"should_download"`
|
||||
ID string `json:"id" binding:"required"`
|
||||
CreatedAt helpers.KontorTime `json:"created_date"`
|
||||
UpdatedAt helpers.KontorTime `json:"last_modified_date"`
|
||||
DeletedAt *time.Time `json:"deleted_date,omitempty"`
|
||||
Version int `json:"version"`
|
||||
CloudLink string `json:"cloud_link"`
|
||||
FileName string `json:"file_name"`
|
||||
Path string `json:"path"`
|
||||
Review bool `json:"review"`
|
||||
Title string `json:"title"`
|
||||
WebLink string `json:"url"`
|
||||
ShouldDownload bool `json:"should_download"`
|
||||
}
|
||||
|
||||
func ConvertMediaFilesToDtos(media_files []MediaFile) []MediaFileDTO {
|
||||
@@ -43,8 +46,8 @@ func ConvertMediaFilesToDtos(media_files []MediaFile) []MediaFileDTO {
|
||||
for i, media_file := range media_files {
|
||||
dtos[i] = MediaFileDTO{
|
||||
ID: media_file.ID,
|
||||
CreatedAt: media_file.CreatedAt,
|
||||
UpdatedAt: media_file.UpdatedAt,
|
||||
CreatedAt: helpers.KontorTime{Time: media_file.CreatedAt},
|
||||
UpdatedAt: helpers.KontorTime{Time: media_file.UpdatedAt},
|
||||
DeletedAt: media_file.DeletedAt,
|
||||
Version: media_file.Version,
|
||||
CloudLink: media_file.CloudLink,
|
||||
|
||||
Reference in New Issue
Block a user