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

This commit is contained in:
Thomas Peetz
2026-10-29 17:40:54 +01:00
parent 2aeba70906
commit 0750621b96
54 changed files with 779 additions and 84 deletions
+17
View File
@@ -35,6 +35,21 @@ type CardSetDTO struct {
VendorID string `json:"vendor_id" binding:"required"`
}
func (dto CardSetDTO) ConvertDTOToModel() CardSet {
model := CardSet{
ID: dto.ID,
CreatedAt: dto.CreatedAt.Time,
UpdatedAt: dto.UpdatedAt.Time,
DeletedAt: dto.DeletedAt,
Version: dto.Version,
Name: dto.Name,
ParallelSet: dto.ParallelSet,
InsertSet: dto.InsertSet,
VendorID: dto.VendorID,
}
return model
}
func ConvertCardSetsToDtos(cardsets []CardSet) []CardSetDTO {
dtos := make([]CardSetDTO, len(cardsets))
for i, cardset := range cardsets {
@@ -52,3 +67,5 @@ func ConvertCardSetsToDtos(cardsets []CardSet) []CardSetDTO {
}
return dtos
}
type CardSetDTOList []CardSetDTO