WIP: Export Kontor DB
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5s

This commit is contained in:
Thomas Peetz
2026-10-01 17:40:17 +02:00
parent f5abb44466
commit 4aaf580735
47 changed files with 1101 additions and 369 deletions
+36 -13
View File
@@ -1,6 +1,9 @@
package models
import "time"
import (
"kontor-api-gin/internal/helpers"
"time"
)
type Profile struct {
ID string `gorm:"type:string;primary_key;" json:"id"`
@@ -35,18 +38,38 @@ func (profile *Profile) GetFullName() string {
return full_name
}
type ProfileDTO_ struct {
ID string `json:"id" binding:"required"`
CreatedAt time.Time `json:"created_date" binding:"required"`
UpdatedAt time.Time `json:"last_modified_date" binding:"required"`
DeletedAt *time.Time `json:"deleted_date" binding:"omitempty"`
Version int `json:"version" binding:"required"`
First_Name *string `json:"first_name" binding:"required"`
Last_Name *string `json:"last_name" binding:"required"`
User_Name string `json:"user_name" binding:"required"`
Email string `json:"email" binding:"required"`
Password string `json:"password" binding:"required"`
Enabled bool `json:"enabled" binding:"required"`
type ProfileDTO struct {
ID string `json:"id" binding:"required"`
CreatedAt helpers.KontorTime `json:"created_date" binding:"required"`
UpdatedAt helpers.KontorTime `json:"last_modified_date" binding:"required"`
DeletedAt *time.Time `json:"deleted_date,omitempty"`
Version int `json:"version" binding:"required"`
First_Name *string `json:"first_name" binding:"required"`
Last_Name *string `json:"last_name" binding:"required"`
User_Name string `json:"user_name" binding:"required"`
Email string `json:"email" binding:"required"`
Password string `json:"password" binding:"required"`
Enabled bool `json:"enabled" binding:"required"`
}
func ConvertProfilesToDtos(profiles []Profile) []ProfileDTO {
dtos := make([]ProfileDTO, len(profiles))
for i, profile := range profiles {
dtos[i] = ProfileDTO{
ID: profile.ID,
CreatedAt: helpers.KontorTime{Time: profile.CreatedAt},
UpdatedAt: helpers.KontorTime{Time: profile.UpdatedAt},
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 dtos
}
type LoginInput struct {