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

This commit is contained in:
Thomas Peetz
2026-10-30 09:15:19 +01:00
parent 8706b3880f
commit b0cc5f0cd1
18 changed files with 437 additions and 28 deletions
+17
View File
@@ -37,6 +37,23 @@ type MailAccountDTO struct {
StartTLS bool `json:"start_tls"`
}
func (dto MailAccountDTO) ConvertDTOToModel() MailAccount {
model := MailAccount{
ID: dto.ID,
CreatedAt: dto.CreatedAt.Time,
UpdatedAt: dto.UpdatedAt.Time,
DeletedAt: dto.DeletedAt,
Version: dto.Version,
Host: dto.Host,
Port: dto.Port,
Protocol: dto.Protocol,
UserName: dto.UserName,
Password: dto.Password,
StartTLS: dto.StartTLS,
}
return model
}
func ConvertMailAccountsToDtos(mailaccounts []MailAccount) []MailAccountDTO {
dtos := make([]MailAccountDTO, len(mailaccounts))
for i, mailaccount := range mailaccounts {