This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"kontor-api-gin/internal/helpers"
|
||||
"time"
|
||||
)
|
||||
|
||||
type MediaLoFi struct {
|
||||
ID string `gorm:"type:string;primary_key;" json:"id"`
|
||||
@@ -11,7 +14,7 @@ type MediaLoFi struct {
|
||||
WebLink string `gorm:"column:url" json:"url"`
|
||||
Review bool `gorm:"column:review" json:"review"`
|
||||
ShouldDownload bool `gorm:"column:should_download" json:"should_download"`
|
||||
Title string `gorm:"size:300, column:title" json:"title"`
|
||||
Title string `gorm:"size:300;column:title" json:"title"`
|
||||
FileName string `gorm:"column:file_name" json:"file_name"`
|
||||
}
|
||||
|
||||
@@ -20,16 +23,16 @@ func (media_lofi *MediaLoFi) TableName() string {
|
||||
}
|
||||
|
||||
type MediaLoFiDTO 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"`
|
||||
WebLink string `json:"url"`
|
||||
Review bool `json:"review"`
|
||||
ShouldDownload bool `json:"should_download"`
|
||||
Title string `json:"title"`
|
||||
FileName string `json:"file_name"`
|
||||
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"`
|
||||
FileName string `json:"file_name"`
|
||||
Review bool `json:"review"`
|
||||
ShouldDownload bool `json:"should_download"`
|
||||
Title string `json:"title"`
|
||||
WebLink string `json:"url"`
|
||||
}
|
||||
|
||||
func ConvertMediaLoFisToDtos(media_lofis []MediaLoFi) []MediaLoFiDTO {
|
||||
@@ -37,8 +40,8 @@ func ConvertMediaLoFisToDtos(media_lofis []MediaLoFi) []MediaLoFiDTO {
|
||||
for i, media_lofi := range media_lofis {
|
||||
dtos[i] = MediaLoFiDTO{
|
||||
ID: media_lofi.ID,
|
||||
CreatedAt: media_lofi.CreatedAt,
|
||||
UpdatedAt: media_lofi.UpdatedAt,
|
||||
CreatedAt: helpers.KontorTime{Time: media_lofi.CreatedAt},
|
||||
UpdatedAt: helpers.KontorTime{Time: media_lofi.UpdatedAt},
|
||||
DeletedAt: media_lofi.DeletedAt,
|
||||
Version: media_lofi.Version,
|
||||
WebLink: media_lofi.WebLink,
|
||||
|
||||
Reference in New Issue
Block a user