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
@@ -52,6 +52,23 @@ type ProfileDTO struct {
Enabled bool `json:"enabled" binding:"required"`
}
func (profile *ProfileDTO) ConvertDTOToModel() Profile {
model := Profile{
ID: profile.ID,
CreatedAt: profile.CreatedAt.Time,
UpdatedAt: profile.UpdatedAt.Time,
DeletedAt: profile.DeletedAt,
Version: profile.Version,
First_Name: profile.First_Name,
Last_Name: profile.Last_Name,
User_Name: profile.User_Name,
Email: profile.Email,
Password: profile.Password,
Enabled: profile.Enabled,
}
return model
}
func ConvertProfilesToDtos(profiles []Profile) []ProfileDTO {
dtos := make([]ProfileDTO, len(profiles))
for i, profile := range profiles {