From 6c40f1a62996420a1af3373111e180e3977d59d4 Mon Sep 17 00:00:00 2001 From: Liujian Date: Thu, 16 Oct 2014 21:36:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=BD=93=E8=A1=A8=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E4=B8=BB=E9=94=AE=E6=97=B6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g_hproseappcode.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/g_hproseappcode.go b/g_hproseappcode.go index 095c139..548e19c 100644 --- a/g_hproseappcode.go +++ b/g_hproseappcode.go @@ -144,19 +144,6 @@ func genHprose(dbms, connStr string, mode byte, selectedTableNames map[string]bo if trans, ok := dbDriver[dbms]; ok { ColorLog("[INFO] Analyzing database tables...\n") tableNames := trans.GetTableNames(db) - // 添加 Hprose Function - 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) mvcPath := new(MvcPath) mvcPath.ModelPath = path.Join(currpath, "models") @@ -216,6 +203,7 @@ func writeHproseModelFiles(tables []*Table, mPath string, selectedTables map[str template = HPROSE_STRUCT_MODEL_TPL } else { template = HPROSE_MODEL_TPL + hproseAddFunctions = append(hproseAddFunctions, strings.Replace(HPROSE_ADDFUNCTION, "{{modelName}}", camelCase(tb.Name), -1)) } fileStr := strings.Replace(template, "{{modelStruct}}", tb.String(), 1) fileStr = strings.Replace(fileStr, "{{modelName}}", camelCase(tb.Name), -1)