diff --git a/template/v4/dto.go.template b/template/v4/dto.go.template index 1aa5bfe4..a9304e0b 100644 --- a/template/v4/dto.go.template +++ b/template/v4/dto.go.template @@ -1,10 +1,6 @@ package dto import ( - "go-admin/app/{{.PackageName}}/models" - "go-admin/common/dto" - common "go-admin/common/models" - {{- $bb := false -}} {{- range .Columns -}} {{$z := .IsQuery}} @@ -18,6 +14,10 @@ import ( {{- if eq $bb true -}} "time" {{- end }} + + "go-admin/app/{{.PackageName}}/models" + "go-admin/common/dto" + common "go-admin/common/models" ) type {{.ClassName}}GetPageReq struct { diff --git a/template/v4/model.go.template b/template/v4/model.go.template index 1862b033..246c5c59 100644 --- a/template/v4/model.go.template +++ b/template/v4/model.go.template @@ -1,9 +1,22 @@ package models import ( - // "gorm.io/gorm" + {{- $bb := false -}} + {{- range .Columns -}} + {{$z := .IsQuery}} + {{- if ($z) }} + {{if eq .GoType "time.Time"}}{{- $bb = true -}}{{- end -}} + {{- end -}} + {{- end -}} + {{- range .Columns -}} + {{if eq .GoType "time.Time"}}{{- $bb = true -}}{{- end -}} + {{- end -}} + {{- if eq $bb true -}} + "time" + {{- end }} "go-admin/common/models" + ) type {{.ClassName}} struct {