refine rpc generator

This commit is contained in:
kevin
2020-08-28 22:44:41 +08:00
parent 72132ce399
commit f411178a4f
8 changed files with 46 additions and 33 deletions

View File

@@ -171,7 +171,7 @@ func (g *defaultGenerator) genModel(in parser.Table, withCache bool) (string, er
"types": typesCode,
"new": newCode,
"insert": insertCode,
"find": strings.Join(findCode, "\r\n"),
"find": strings.Join(findCode, "\n"),
"update": updateCode,
"delete": deleteCode,
})

View File

@@ -20,7 +20,7 @@ func genVars(table Table, withCache bool) (string, error) {
Execute(map[string]interface{}{
"lowerStartCamelObject": stringx.From(camel).UnTitle(),
"upperStartCamelObject": camel,
"cacheKeys": strings.Join(keys, "\r\n"),
"cacheKeys": strings.Join(keys, "\n"),
"autoIncrement": table.PrimaryKey.AutoIncrement,
"originalPrimaryKey": table.PrimaryKey.Name.Source(),
"withCache": withCache,