add subproject kontor-gin
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s

This commit is contained in:
Thomas Peetz
2026-09-18 17:42:50 +02:00
parent c1d913e36b
commit 8f5a384e89
10 changed files with 458 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package schema
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
type Base struct {
ID string `gorm:"type:string;primary_key;"`
CreatedAt time.Time `json:"created_date"`
UpdatedAt time.Time `json:"last_modified_date"`
DeletedAt *time.Time `json:"deleted_date"`
Version int `gorm:"default:0" json:"version"`
}
// BeforeCreate will set a UUID rather than numeric ID.
func (b *Base) BeforeCreate(tx *gorm.DB) (err error) {
b.ID = uuid.New().String()
return
}