add methods in Repository an dModel for importing data
This commit is contained in:
@@ -33,6 +33,20 @@ type StoryArcDTO struct {
|
||||
VolumeID *string `json:"volume_id"`
|
||||
}
|
||||
|
||||
func (dto StoryArcDTO) ConvertDTOToModel() StoryArc {
|
||||
model := StoryArc{
|
||||
ID: dto.ID,
|
||||
CreatedAt: dto.CreatedAt.Time,
|
||||
UpdatedAt: dto.UpdatedAt.Time,
|
||||
DeletedAt: dto.DeletedAt,
|
||||
Version: dto.Version,
|
||||
Name: dto.Name,
|
||||
ComicID: dto.ComicID,
|
||||
VolumeID: dto.VolumeID,
|
||||
}
|
||||
return model
|
||||
}
|
||||
|
||||
func ConvertStoryArcsToDtos(storyarcs []StoryArc) []StoryArcDTO {
|
||||
dtos := make([]StoryArcDTO, len(storyarcs))
|
||||
for i, storyarc := range storyarcs {
|
||||
|
||||
Reference in New Issue
Block a user