diff --git a/apiV1Response.go b/apiV1Response.go index 6949f45..d13e63b 100644 --- a/apiV1Response.go +++ b/apiV1Response.go @@ -1,7 +1,7 @@ package main import ( - "biukop/sfm/loan" + "biukop.com/sfm/loan" "encoding/json" "fmt" "net/http" @@ -13,7 +13,7 @@ type apiV1Envelop struct { Success bool Msg string TimeStamp string - Body interface{} + Body map[string]interface{} Session loan.Session } @@ -30,6 +30,7 @@ func apiV1EnvelopBlank() (ret apiV1Envelop) { Msg: "", TimeStamp: ts, } + ret.Body = make(map[string]interface{}) return } @@ -54,7 +55,9 @@ func (m *apiV1Response) toJson() (ret []byte, e error) { func (m *apiV1Response) sendJson(w http.ResponseWriter) (ret []byte, e error) { tempMap := m.tmp m.tmp = nil - tempMap["_"] = m.Env + if config.Debug { + tempMap["_"] = m.Env + } ret, e = json.Marshal(tempMap) //sent w.Header().Set("Content-Type", "text/json; charset=utf-8")