mirror of
https://github.com/hay-kot/homebox.git
synced 2024-12-28 01:36:30 +00:00
cd82fe0d89
* remove empty services * remove old factory * remove old static files * cleanup more duplicate service code * file/folder reorg
18 lines
No EOL
573 B
Cheetah
18 lines
No EOL
573 B
Cheetah
{{/* The line below tells Intellij/GoLand to enable the autocompletion based on the *gen.Graph type. */}}
|
|
{{/* gotype: entgo.io/ent/entc/gen.Graph */}}
|
|
|
|
{{ define "has_id" }}
|
|
|
|
{{/* Add the base header for the generated file */}}
|
|
{{ $pkg := base $.Config.Package }}
|
|
{{ template "header" $ }}
|
|
import "github.com/google/uuid"
|
|
{{/* Loop over all nodes and implement the "HasID" interface */}}
|
|
{{ range $n := $.Nodes }}
|
|
{{ $receiver := $n.Receiver }}
|
|
func ({{ $receiver }} *{{ $n.Name }}) GetID() uuid.UUID {
|
|
return {{ $receiver }}.ID
|
|
}
|
|
{{ end }}
|
|
|
|
{{ end }} |