接入RESTfull风格接口

This commit is contained in:
hoteas
2021-05-30 00:01:15 +08:00
parent c46fdd8985
commit 465ea889a2
4 changed files with 15 additions and 5 deletions
+2 -2
View File
@@ -142,7 +142,7 @@ func (that *HoTimeDB) Row(resl *sql.Rows) []Map {
if a[j] != nil && reflect.ValueOf(a[j]).Type().String() == "[]uint8" {
lis[strs[j]] = string(a[j].([]byte))
} else {
lis[strs[j]] = a[j]
lis[strs[j]] = a[j] //取实际类型
}
}
@@ -472,7 +472,7 @@ func (that *HoTimeDB) Select(table string, qu ...interface{}) []Map {
//如果缓存有则从缓存取
cacheData := that.HoTimeCache.Db(table + ":" + md5)
if cacheData.Data != nil {
if cacheData != nil && cacheData.Data != nil {
return cacheData.ToMapArray()
}
}