fix🐛: Fix the newline problem in time package in code generation
Fix gen code problem
This commit is contained in:
2 files changed
+19
-4
No files matched your search
@@ -1,9 +1,6 @@
|
|||||||
package dto
|
package dto
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go-admin/app/{{.PackageName}}/models"
|
|
||||||
"go-admin/common/dto"
|
|
||||||
common "go-admin/common/models"
|
|
||||||
|
|
||||||
{{- $bb := false -}}
|
{{- $bb := false -}}
|
||||||
{{- range .Columns -}}
|
{{- range .Columns -}}
|
||||||
@@ -18,6 +15,10 @@ import (
|
|||||||
{{- if eq $bb true -}}
|
{{- if eq $bb true -}}
|
||||||
"time"
|
"time"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
"go-admin/app/{{.PackageName}}/models"
|
||||||
|
"go-admin/common/dto"
|
||||||
|
common "go-admin/common/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type {{.ClassName}}GetPageReq struct {
|
type {{.ClassName}}GetPageReq struct {
|
||||||
|
|||||||
@@ -1,9 +1,23 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
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"
|
"go-admin/common/models"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type {{.ClassName}} struct {
|
type {{.ClassName}} struct {
|
||||||
|
|||||||
Reference in new issue
Block a user