|
|
@ -29,9 +29,7 @@ func genCacheKeys(table parser.Table) (map[string]Key, error) {
|
|
|
|
camelTableName := table.Name.ToCamel()
|
|
|
|
camelTableName := table.Name.ToCamel()
|
|
|
|
lowerStartCamelTableName := stringx.From(camelTableName).UnTitle()
|
|
|
|
lowerStartCamelTableName := stringx.From(camelTableName).UnTitle()
|
|
|
|
for _, field := range fields {
|
|
|
|
for _, field := range fields {
|
|
|
|
if !field.IsKey {
|
|
|
|
if field.IsUniqueKey || field.IsPrimaryKey {
|
|
|
|
continue
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
camelFieldName := field.Name.ToCamel()
|
|
|
|
camelFieldName := field.Name.ToCamel()
|
|
|
|
lowerStartCamelFieldName := stringx.From(camelFieldName).UnTitle()
|
|
|
|
lowerStartCamelFieldName := stringx.From(camelFieldName).UnTitle()
|
|
|
|
left := fmt.Sprintf("cache%s%sPrefix", camelTableName, camelFieldName)
|
|
|
|
left := fmt.Sprintf("cache%s%sPrefix", camelTableName, camelFieldName)
|
|
|
@ -47,5 +45,6 @@ func genCacheKeys(table parser.Table) (map[string]Key, error) {
|
|
|
|
RespKeyExpression: fmt.Sprintf(`%s := fmt.Sprintf("%s%s", %s,resp.%s)`, variable, "%s", "%v", left, camelFieldName),
|
|
|
|
RespKeyExpression: fmt.Sprintf(`%s := fmt.Sprintf("%s%s", %s,resp.%s)`, variable, "%s", "%v", left, camelFieldName),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return m, nil
|
|
|
|
return m, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|