From eaae7694b883eeabc34520293b17d8298bf082f5 Mon Sep 17 00:00:00 2001 From: Liujian Date: Wed, 15 Oct 2014 13:59:05 +0800 Subject: [PATCH] Modified bug of use -tables arguments. --- g_hproseappcode.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/g_hproseappcode.go b/g_hproseappcode.go index d1e369e..fc2830d 100644 --- a/g_hproseappcode.go +++ b/g_hproseappcode.go @@ -145,8 +145,16 @@ func genHprose(dbms, connStr string, mode byte, selectedTableNames map[string]bo ColorLog("[INFO] Analyzing database tables...\n") tableNames := trans.GetTableNames(db) // 添加 Hprose Function - for _, tb := range tableNames { - hproseAddFunctions = append(hproseAddFunctions, strings.Replace(HPROSE_ADDFUNCTION, "{{modelName}}", camelCase(tb), -1)) + if selectedTableNames == nil { + for _, tb := range tableNames { + hproseAddFunctions = append(hproseAddFunctions, strings.Replace(HPROSE_ADDFUNCTION, "{{modelName}}", camelCase(tb), -1)) + } + } else { + for tb, v := range selectedTableNames { + if v { + hproseAddFunctions = append(hproseAddFunctions, strings.Replace(HPROSE_ADDFUNCTION, "{{modelName}}", camelCase(tb), -1)) + } + } } // 添加结束 tables := getTableObjects(tableNames, db, trans)