fix: template cache key (#121)

This commit is contained in:
Keson
2020-10-12 14:34:11 +08:00
committed by GitHub
parent 936dd67008
commit 7d4a548d29
2 changed files with 2 additions and 2 deletions

View File

@@ -25,7 +25,6 @@ func genFindOneByField(table Table, withCache bool) (string, string, error) {
"withCache": withCache,
"cacheKey": table.CacheKey[field.Name.Source()].KeyExpression,
"cacheKeyVariable": table.CacheKey[field.Name.Source()].Variable,
"primaryKeyLeft": table.CacheKey[table.PrimaryKey.Name.Source()].Left,
"lowerStartCamelObject": stringx.From(camelTableName).UnTitle(),
"lowerStartCamelField": stringx.From(camelFieldName).UnTitle(),
"upperStartCamelPrimaryKey": table.PrimaryKey.Name.ToCamel(),
@@ -39,6 +38,7 @@ func genFindOneByField(table Table, withCache bool) (string, string, error) {
if withCache {
out, err := util.With("findOneByFieldExtraMethod").Parse(template.FindOneByFieldExtraMethod).Execute(map[string]interface{}{
"upperStartCamelObject": camelTableName,
"primaryKeyLeft": table.CacheKey[table.PrimaryKey.Name.Source()].Left,
"lowerStartCamelObject": stringx.From(camelTableName).UnTitle(),
"originalPrimaryField": table.PrimaryKey.Name.Source(),
})