框架基本完成

This commit is contained in:
hoteas
2017-08-10 10:14:56 +00:00
parent e02a80fda8
commit b07bc3c9b9
8 changed files with 242 additions and 203 deletions
+8 -1
View File
@@ -4,6 +4,7 @@ import (
"encoding/json"
"net/http"
"time"
"errors"
)
type Context struct {
@@ -43,7 +44,13 @@ func (this *Context) Display(statu int, data interface{}) {
resp := Map{"statu": statu}
if statu != 0 {
temp := Map{}
temp["type"] = 0
tpe:=this.Config.GetMap("error").GetString(ObjToStr(statu))
if tpe==""{
this.LastErr.SetError(errors.New("找不到对应的错误码"))
}
temp["type"] = tpe
temp["msg"] = data
resp["result"] = temp
} else {