From a0b28c40889701cbd59dba5e8c095589289844e7 Mon Sep 17 00:00:00 2001 From: xxj <346944475@qq.com> Date: Fri, 8 Jan 2021 14:15:47 +0800 Subject: [PATCH] add datatypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 datatypes 支持 --- data/view/cnf/def.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/data/view/cnf/def.go b/data/view/cnf/def.go index 8750e26..d9b6531 100644 --- a/data/view/cnf/def.go +++ b/data/view/cnf/def.go @@ -2,10 +2,12 @@ package cnf // EImportsHead imports head options. import包含选项 var EImportsHead = map[string]string{ - "stirng": `"string"`, - "time.Time": `"time"`, - "gorm.Model": `"gorm.io/gorm"`, - "fmt": `"fmt"`, + "stirng": `"string"`, + "time.Time": `"time"`, + "gorm.Model": `"gorm.io/gorm"`, + "fmt": `"fmt"`, + "datatypes.JSON": `"gorm.io/datatypes"`, + "datatypes.Date": `"gorm.io/datatypes"`, } // TypeMysqlDicMp Accurate matching type.精确匹配类型 @@ -18,14 +20,14 @@ var TypeMysqlDicMp = map[string]string{ "bigint unsigned": "uint64", "varchar": "string", "char": "string", - "date": "time.Time", + "date": "datatypes.Date", "datetime": "time.Time", "bit(1)": "[]uint8", "tinyint": "int8", "tinyint unsigned": "uint8", "tinyint(1)": "bool", // tinyint(1) 默认设置成bool "tinyint(1) unsigned": "bool", // tinyint(1) 默认设置成bool - "json": "string", + "json": "datatypes.JSON", "text": "string", "timestamp": "time.Time", "double": "float64",