modify model
This commit is contained in:
@@ -268,7 +268,7 @@ func (g *defaultGenerator) genModel(in parser.Table, withCache bool) (string, er
|
||||
table.ContainsUniqueCacheKey = len(uniqueKey) > 0
|
||||
table.ignoreColumns = g.ignoreColumns
|
||||
|
||||
importsCode, err := genImports(table, withCache, in.ContainsTime())
|
||||
importsCode, err := genImports(table, withCache, in.ContainsTime(), in.ContainsDecimal())
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/util/pathx"
|
||||
)
|
||||
|
||||
func genImports(table Table, withCache, timeImport bool) (string, error) {
|
||||
func genImports(table Table, withCache, timeImport, decimalImport bool) (string, error) {
|
||||
if withCache {
|
||||
text, err := pathx.LoadTemplate(category, importsTemplateFile, template.Imports)
|
||||
if err != nil {
|
||||
@@ -17,6 +17,7 @@ func genImports(table Table, withCache, timeImport bool) (string, error) {
|
||||
"time": timeImport,
|
||||
"containsPQ": table.ContainsPQ,
|
||||
"data": table,
|
||||
"decimal": decimalImport,
|
||||
})
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -34,6 +35,7 @@ func genImports(table Table, withCache, timeImport bool) (string, error) {
|
||||
"time": timeImport,
|
||||
"containsPQ": table.ContainsPQ,
|
||||
"data": table,
|
||||
"decimal": decimalImport,
|
||||
})
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
Reference in New Issue
Block a user