From 90942ff2220a16f609946754af96ad92a566634b Mon Sep 17 00:00:00 2001 From: yxh Date: Tue, 7 Sep 2021 09:48:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=AF=BC?= =?UTF-8?q?=E5=8C=85=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/global/version.go | 10 ++++++++++ boot/boot.go | 6 ++---- template/vm/go/dao.template | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 app/common/global/version.go diff --git a/app/common/global/version.go b/app/common/global/version.go new file mode 100644 index 0000000..9381913 --- /dev/null +++ b/app/common/global/version.go @@ -0,0 +1,10 @@ +/* +* @desc:版本号 +* @company:云南省奇讯科技有限公司 +* @Author: yixiaohu +* @Date: 2021/9/6 16:25 + */ + +package global + +const Version = "2.0.3" diff --git a/boot/boot.go b/boot/boot.go index 688a8aa..606ede9 100644 --- a/boot/boot.go +++ b/boot/boot.go @@ -2,6 +2,7 @@ package boot import ( "fmt" + "gfast/app/common/global" _ "gfast/packed" _ "gfast/task" "github.com/gogf/gf/frame/g" @@ -9,9 +10,6 @@ import ( "github.com/gogf/gf/os/gtime" ) -//版本号 -const Version = "2.0.3" - func init() { gtime.SetTimeZone("Asia/Shanghai") //设置系统时区 showLogo() @@ -20,5 +18,5 @@ func init() { func showLogo() { fmt.Println(" .----------------. .----------------. .----------------. .----------------. .----------------. \n| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |\n| | ______ | || | _________ | || | __ | || | _______ | || | _________ | |\n| | .' ___ | | || | |_ ___ | | || | / \\ | || | / ___ | | || | | _ _ | | |\n| | / .' \\_| | || | | |_ \\_| | || | / /\\ \\ | || | | (__ \\_| | || | |_/ | | \\_| | |\n| | | | ____ | || | | _| | || | / ____ \\ | || | '.___`-. | || | | | | |\n| | \\ `.___] _| | || | _| |_ | || | _/ / \\ \\_ | || | |`\\____) | | || | _| |_ | |\n| | `._____.' | || | |_____| | || ||____| |____|| || | |_______.' | || | |_____| | |\n| | | || | | || | | || | | || | | |\n| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |\n '----------------' '----------------' '----------------' '----------------' '----------------' ") - fmt.Println("当前版本:", Version) + fmt.Println("当前版本:", global.Version) } diff --git a/template/vm/go/dao.template b/template/vm/go/dao.template index 3ea026b..f4c9cbf 100644 --- a/template/vm/go/dao.template +++ b/template/vm/go/dao.template @@ -9,7 +9,7 @@ package dao {{$hasGTime:=false}} {{range $index, $column := .table.Columns}} -{{if and (eq $column.GoType "Time") (or (eq $column.IsInsert "1") (eq $column.IsEdit "1"))}} +{{if eq $column.GoType "Time"}} {{$hasGTime = true}} {{end}} {{end}}