框架基本完成
This commit is contained in:
+8
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user