From 34b3395d15cd3674e9852666491d7197292daba1 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Mon, 10 Jan 2022 13:17:28 +0800 Subject: [PATCH 1/3] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 860b6290..4338902d 100644 --- a/README.md +++ b/README.md @@ -161,10 +161,10 @@ cgo: exec gcc: exec: "gcc": executable file not found in %PATH% ``` bash # The first configuration needs to initialize the database resource information # Use under macOS or linux -$ ./go-admin migrate -c=config/settings.dev.yml +$ ./go-admin migrate -c config/settings.dev.yml # ⚠️Note: Use under windows -$ go-admin.exe migrate -c=config/settings.dev.yml +$ go-admin.exe migrate -c config/settings.dev.yml # Start the project, you can also use the IDE for debugging # Use under macOS or linux @@ -274,4 +274,4 @@ The `go-admin` project has always been developed in the GoLand integrated develo [MIT](https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md) -Copyright (c) 2020 wenjianzhang \ No newline at end of file +Copyright (c) 2020 wenjianzhang From 3cfa7a2767ceba1bd638f8ec1c0b329e67ab9bb0 Mon Sep 17 00:00:00 2001 From: horizonzy Date: Mon, 31 Jan 2022 12:00:26 +0800 Subject: [PATCH 2/3] fix code gen problem. --- template/v4/dto.go.template | 8 ++++---- template/v4/model.go.template | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) 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 { From b52da434bb397cd3e405aa40f0cff00e20edaec8 Mon Sep 17 00:00:00 2001 From: horizonzy Date: Mon, 31 Jan 2022 13:00:21 +0800 Subject: [PATCH 3/3] fix code gen problem. --- template/v4/dto.go.template | 1 + template/v4/model.go.template | 1 + 2 files changed, 2 insertions(+) diff --git a/template/v4/dto.go.template b/template/v4/dto.go.template index a9304e0b..69178021 100644 --- a/template/v4/dto.go.template +++ b/template/v4/dto.go.template @@ -1,6 +1,7 @@ package dto import ( + {{- $bb := false -}} {{- range .Columns -}} {{$z := .IsQuery}} diff --git a/template/v4/model.go.template b/template/v4/model.go.template index 246c5c59..1e34cd9b 100644 --- a/template/v4/model.go.template +++ b/template/v4/model.go.template @@ -1,6 +1,7 @@ package models import ( + {{- $bb := false -}} {{- range .Columns -}} {{$z := .IsQuery}}