提交 59b21d69 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

fix bugs on github

上级 9804834a
......@@ -6,6 +6,10 @@ version: 1.0
from: jenkins.ip.private.yaml
fields:
- field: field_use_ranges
prefix: ""
postfix: "]"
- field: field_use_instance
prefix: ""
postfix: "]"
......
......@@ -17,10 +17,10 @@ func Upgrade() {
// TODO: update date from remote server
// read data from db
db, err := sql.Open(constant.SqliteDriver, constant.SqliteSource)
db, err := sql.Open(constant.SqliteDriver, constant.SqliteData)
defer db.Close()
if err != nil {
logUtils.PrintTo(i118Utils.I118Prt.Sprintf("fail_to_connect_sqlite", constant.SqliteSource, err.Error()))
logUtils.PrintTo(i118Utils.I118Prt.Sprintf("fail_to_connect_sqlite", constant.SqliteData, err.Error()))
return
}
......
......@@ -178,21 +178,23 @@ func CopyField(child model.DefField, parent *model.DefField) {
if child.Range != "" {
(*parent).Range = child.Range
}
if child.Prefix != "" {
//if child.Prefix != "" {
(*parent).Prefix = child.Prefix
}
if child.Postfix != "" {
//}
//if child.Postfix != "" {
(*parent).Postfix = child.Postfix
}
//}
if child.Loop != "" {
(*parent).Loop = child.Loop
}
if child.Loopfix != "" {
//if child.Loopfix != "" {
(*parent).Loopfix = child.Loopfix
}
if child.Format != "" {
//}
//if child.Format != "" {
(*parent).Format = child.Format
}
//}
if child.From != "" {
(*parent).From = child.From
......
......@@ -136,7 +136,7 @@ func ConvertExcelToSQLiteIfNeeded(dbName string, path string) (firstSheet string
ddl := fmt.Sprintf(ddlTemplate, tableName, colDefine)
insertSql := fmt.Sprintf(insertTemplate, tableName, colList, valList)
db, err := sql.Open("sqlite3", constant.SqliteSource)
db, err := sql.Open("sqlite3", constant.SqliteData)
defer db.Close()
_, err = db.Exec(dropSql)
if err != nil {
......@@ -163,10 +163,10 @@ func ConvertExcelToSQLiteIfNeeded(dbName string, path string) (firstSheet string
func ReadDataFromSQLite(field model.DefField, dbName string, tableName string) ([]string, string) {
list := make([]string, 0)
db, err := sql.Open(constant.SqliteDriver, constant.SqliteSource)
db, err := sql.Open(constant.SqliteDriver, constant.SqliteData)
defer db.Close()
if err != nil {
logUtils.PrintTo(i118Utils.I118Prt.Sprintf("fail_to_connect_sqlite", constant.SqliteSource, err.Error()))
logUtils.PrintTo(i118Utils.I118Prt.Sprintf("fail_to_connect_sqlite", constant.SqliteData, err.Error()))
return list, ""
}
......@@ -241,10 +241,10 @@ func ReadDataFromSQLite(field model.DefField, dbName string, tableName string) (
}
func isExcelChanged(path string) bool {
db, err := sql.Open(constant.SqliteDriver, constant.SqliteSource)
db, err := sql.Open(constant.SqliteDriver, constant.SqliteData)
defer db.Close()
if err != nil {
logUtils.PrintTo(i118Utils.I118Prt.Sprintf("fail_to_connect_sqlite", constant.SqliteSource, err.Error()))
logUtils.PrintTo(i118Utils.I118Prt.Sprintf("fail_to_connect_sqlite", constant.SqliteData, err.Error()))
return true
}
......
package gen
func ParseSql(defFile string, out string) {
}
\ No newline at end of file
......@@ -60,8 +60,10 @@ var (
TmpDir = "tmp/"
SqliteDriver = "sqlite3"
SqliteSource = "file:" + TmpDir + "cache/.data.db"
SqliteDriver = "sqlite3"
SqliteData = "file:" + TmpDir + "cache/.data.db"
SqliteWords = "file:" + TmpDir + "cache/.words.db"
SqliteTrackTable = "excel_update"
ExcelBorder = `{"border": [{"type":"left","color":"999999","style":1}, {"type":"top","color":"999999","style":1},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册