add console & example

This commit is contained in:
anqiansong
2020-08-15 18:38:55 +08:00
parent c519345924
commit 790b29b8eb
18 changed files with 522 additions and 59 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/tal-tech/go-zero/tools/goctl/util/templatex"
)
func genVars(table Table) (string, error) {
func genVars(table Table, withCache bool) (string, error) {
keys := make([]string, 0)
for _, v := range table.CacheKey {
keys = append(keys, v.VarExpression)
@@ -23,6 +23,7 @@ func genVars(table Table) (string, error) {
"cacheKeys": strings.Join(keys, "\r\n"),
"autoIncrement": table.PrimaryKey.AutoIncrement,
"originalPrimaryKey": table.PrimaryKey.Name.Source(),
"withCache": withCache,
})
if err != nil {
return "", err