ormat🥚 :优化生成模版

This commit is contained in:
wenjianzhang committed 2021-03-11 14:56:15 +08:00
1 parent a43413d1ff
commit 75b529d7b0
7 files changed
+78 -24

No files matched your search

+2 -2
View File
@@ -8,11 +8,9 @@ import (
type {{.ClassName}} struct {
models.Model
models.ControlBy
{{ range .Columns -}}
{{$x := .Pk}}
{{- if ($x) }}
{{- else if eq .GoField "CreatedAt" -}}
{{- else if eq .GoField "UpdatedAt" -}}
{{- else if eq .GoField "DeletedAt" -}}
@@ -21,6 +19,8 @@ type {{.ClassName}} struct {
{{- else }}
{{.GoField}} {{.GoType}} `json:"{{.JsonField}}" gorm:"type:{{.ColumnType}};comment:{{- if eq .ColumnComment "" -}}{{.GoField}}{{- else -}}{{.ColumnComment}}{{end -}}"` {{end -}}
{{- end }}
models.ModelTime
models.ControlBy
}
func ({{.ClassName}}) TableName() string {