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
+15
View File
@@ -31,6 +31,19 @@ type AssignmentDTO struct {
PermissionID *string `json:"permission_id"`
}
func (dto *AssignmentDTO) ConvertDTOToModel() Assignment {
model := Assignment{
ID: dto.ID,
CreatedAt: dto.CreatedAt.Time,
UpdatedAt: dto.UpdatedAt.Time,
DeletedAt: dto.DeletedAt,
Version: dto.Version,
ProfileID: dto.ProfileID,
PermissionID: dto.PermissionID,
}
return model
}
func ConvertAssignmentsToDtos(assignments []Assignment) []AssignmentDTO {
dtos := make([]AssignmentDTO, len(assignments))
for i, assignment := range assignments {
@@ -46,3 +59,5 @@ func ConvertAssignmentsToDtos(assignments []Assignment) []AssignmentDTO {
}
return dtos
}
type AssignmentDTOList []AssignmentDTO