From 9af232840cc3412e166ec5c091c3ec4f508acfe5 Mon Sep 17 00:00:00 2001 From: hoteas Date: Sun, 30 May 2021 00:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=85=A5RESTfull=E9=A3=8E=E6=A0=BC?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/db.go | 13 +++++++------ example/admin/user.go | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/db/db.go b/db/db.go index 84b6e70..2b00120 100644 --- a/db/db.go +++ b/db/db.go @@ -139,6 +139,7 @@ func (that *HoTimeDB) Row(resl *sql.Rows) []Map { return nil } for j := 0; j < len(a); j++ { + //fmt.Println(reflect.ValueOf(a[j]).Type().String() ) if a[j] != nil && reflect.ValueOf(a[j]).Type().String() == "[]uint8" { lis[strs[j]] = string(a[j].([]byte)) } else { @@ -147,12 +148,12 @@ func (that *HoTimeDB) Row(resl *sql.Rows) []Map { } //防止int被误读为float64 - jlis, e := json.Marshal(lis) - if e != nil { - that.LastErr.SetError(e) - } else { - lis.JsonToMap(string(jlis), that.LastErr) - } + //jlis, e := json.Marshal(lis) + //if e != nil { + // that.LastErr.SetError(e) + //} else { + // lis.JsonToMap(string(jlis), that.LastErr) + //} dest = append(dest, lis) diff --git a/example/admin/user.go b/example/admin/user.go index 678128e..b7e6c91 100644 --- a/example/admin/user.go +++ b/example/admin/user.go @@ -24,7 +24,7 @@ var UserCtr = Ctr{ }, "search": func(this *Context) { user := this.Db.Select(this.RouterString[1], "*") - fmt.Println(user) + fmt.Println(user, user[0].GetFloat64("age")) this.Display(0, user) }, }