fix🐛: Fix the newline problem in time package in code generation

Fix gen code problem
This commit is contained in:
wenjianzhang authored and GitHub committed 2022-03-05 11:11:34 +08:00
commit 7f1aa89539
2 files changed
+19 -4

No files matched your search

+4 -3
View File
@@ -1,9 +1,6 @@
package dto
import (
"go-admin/app/{{.PackageName}}/models"
"go-admin/common/dto"
common "go-admin/common/models"
{{- $bb := false -}}
{{- range .Columns -}}
@@ -18,6 +15,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 {
+15 -1
View File
@@ -1,9 +1,23 @@
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 {