add methods in Repository and Model for importing data
This commit is contained in:
@@ -79,6 +79,22 @@ type MediaMusicDTO struct {
|
||||
WebLink string `json:"url"`
|
||||
}
|
||||
|
||||
func (dto MediaMusicDTO) ConvertDTOToModel() MediaMusic {
|
||||
model := MediaMusic{
|
||||
ID: dto.ID,
|
||||
CreatedAt: dto.CreatedAt.Time,
|
||||
UpdatedAt: dto.UpdatedAt.Time,
|
||||
DeletedAt: dto.DeletedAt,
|
||||
Version: dto.Version,
|
||||
FileName: dto.FileName,
|
||||
Review: dto.Review,
|
||||
ShouldDownload: dto.ShouldDownload,
|
||||
Title: dto.Title,
|
||||
WebLink: dto.WebLink,
|
||||
}
|
||||
return model
|
||||
}
|
||||
|
||||
func (source MediaMusicDTO) Equals(target MediaMusicDTO) bool {
|
||||
if config.Verbose > 1 {
|
||||
slog.Info("MediaMusicDTO#Equals", "id", source.ID)
|
||||
|
||||
Reference in New Issue
Block a user