update
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s

This commit is contained in:
2026-10-11 01:13:58 +02:00
parent 0c5013f4a8
commit 58b26304ae
9 changed files with 127300 additions and 168 deletions
+33
View File
@@ -1,7 +1,9 @@
package models
import (
"fmt"
"kontor-api-gin/internal/helpers"
"log/slog"
"time"
)
@@ -39,6 +41,37 @@ type MediaLoFiDTO struct {
WebLink string `json:"url"`
}
type MediaLoFiDTOList []MediaLoFiDTO
func (source *MediaLoFiDTOList) CompareIds(target *MediaLoFiDTOList) (missing, obsolete []string) {
sources := make(map[string]MediaLoFiDTO, len(*source))
targets := make(map[string]MediaLoFiDTO, len(*target))
for _, source := range *source {
sources[source.ID] = source
}
for _, target := range *target {
targets[target.ID] = target
}
// iterate source IDs
for id := range sources {
if _, ok := targets[id]; ok {
slog.Debug(fmt.Sprintf("ID %s found in both lists", id))
} else {
missing = append(missing, id)
}
}
for id := range targets {
if _, ok := sources[id]; ok {
slog.Debug(fmt.Sprintf("ID %s found in both lists", id))
} else {
obsolete = append(obsolete, id)
}
}
slog.Info("CompareIds", "missing", len(missing), "obsolete", len(obsolete))
slog.Debug("CompareIds", "missing", missing, "obsolete", obsolete)
return missing, obsolete
}
func ConvertMediaLoFisToDtos(media_lofis []MediaLoFi) []MediaLoFiDTO {
dtos := make([]MediaLoFiDTO, len(media_lofis))
for i, media_lofi := range media_lofis {
+2 -2
View File
@@ -46,14 +46,14 @@ func (playerList *PlayerDTOList) CompareIds(target *PlayerDTOList) (missing, obs
// iterate source IDs
for id := range sources {
if _, ok := targets[id]; ok {
slog.Info(fmt.Sprintf("ID %s found in both lists", id))
slog.Debug(fmt.Sprintf("ID %s found in both lists", id))
} else {
missing = append(missing, id)
}
}
for id := range targets {
if _, ok := sources[id]; ok {
slog.Info(fmt.Sprintf("ID %s found in both lists", id))
slog.Debug(fmt.Sprintf("ID %s found in both lists", id))
} else {
obsolete = append(obsolete, id)
}
+2 -2
View File
@@ -43,14 +43,14 @@ func (sportList *SportDTOList) CompareIds(target *SportDTOList) (missing, obsole
// iterate source IDs
for id := range sources {
if _, ok := targets[id]; ok {
slog.Info(fmt.Sprintf("ID %s found in both lists", id))
slog.Debug(fmt.Sprintf("ID %s found in both lists", id))
} else {
missing = append(missing, id)
}
}
for id := range targets {
if _, ok := sources[id]; ok {
slog.Info(fmt.Sprintf("ID %s found in both lists", id))
slog.Debug(fmt.Sprintf("ID %s found in both lists", id))
} else {
obsolete = append(obsolete, id)
}