Init V4 community edition (#2265)

* Init V4 community edition

* Init V4 community edition
This commit is contained in:
AaronLiu
2025-04-20 17:31:25 +08:00
committed by GitHub
parent da4e44b77a
commit 21d158db07
597 changed files with 119415 additions and 41692 deletions

View File

@@ -0,0 +1,20 @@
{{/* The line below tells Intellij/GoLand to enable the autocompletion based *gen.Type type. */}}
{{/* gotype: entgo.io/ent/entc/gen.Type */}}
{{ define "model/additional/edgehelper" }}
{{/* A template that adds the "GoString" method to all generated models on the same file they are defined. */}}
{{- with $.Edges }}
{{- range $i, $e := . }}
// Set{{ $e.StructField }} manually set the edge as loaded state.
func (e *{{ $.Name }}) Set{{ $e.StructField }}(v {{ if not $e.Unique }}[]{{ end }}*{{ $e.Type.Name }}) {
e.Edges.{{ $e.StructField }} = v
e.Edges.loadedTypes[{{ $i }}] = true
}
{{- end }}
{{- end }}
{{ end }}