add methods in Repository and Model for importing data
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5s
Gitea Actions Demo / build-and-test (push) Failing after 14m37s

This commit is contained in:
Thomas Peetz
2026-10-30 09:15:19 +01:00
parent 8706b3880f
commit b0cc5f0cd1
18 changed files with 437 additions and 28 deletions
+18
View File
@@ -55,6 +55,24 @@ type MediaFileDTO struct {
ShouldDownload bool `json:"should_download"`
}
func (dto MediaFileDTO) ConvertDTOToModel() MediaFile {
model := MediaFile{
ID: dto.ID,
CreatedAt: dto.CreatedAt.Time,
UpdatedAt: dto.UpdatedAt.Time,
DeletedAt: dto.DeletedAt,
Version: dto.Version,
CloudLink: dto.CloudLink,
FileName: dto.FileName,
Path: dto.Path,
Review: dto.Review,
ShouldDownload: dto.ShouldDownload,
Title: dto.Title,
WebLink: dto.WebLink,
}
return model
}
func ConvertMediaFilesToDtos(media_files []MediaFile) []MediaFileDTO {
dtos := make([]MediaFileDTO, len(media_files))
for i, media_file := range media_files {