| package main | package main | ||||
| import ( | import ( | ||||
| "biukop/sfm/loan" | |||||
| "biukop.com/sfm/loan" | |||||
| "encoding/json" | "encoding/json" | ||||
| "fmt" | "fmt" | ||||
| "net/http" | "net/http" | ||||
| Success bool | Success bool | ||||
| Msg string | Msg string | ||||
| TimeStamp string | TimeStamp string | ||||
| Body interface{} | |||||
| Body map[string]interface{} | |||||
| Session loan.Session | Session loan.Session | ||||
| } | } | ||||
| Msg: "", | Msg: "", | ||||
| TimeStamp: ts, | TimeStamp: ts, | ||||
| } | } | ||||
| ret.Body = make(map[string]interface{}) | |||||
| return | return | ||||
| } | } | ||||
| func (m *apiV1Response) sendJson(w http.ResponseWriter) (ret []byte, e error) { | func (m *apiV1Response) sendJson(w http.ResponseWriter) (ret []byte, e error) { | ||||
| tempMap := m.tmp | tempMap := m.tmp | ||||
| m.tmp = nil | m.tmp = nil | ||||
| tempMap["_"] = m.Env | |||||
| if config.Debug { | |||||
| tempMap["_"] = m.Env | |||||
| } | |||||
| ret, e = json.Marshal(tempMap) | ret, e = json.Marshal(tempMap) | ||||
| //sent | //sent | ||||
| w.Header().Set("Content-Type", "text/json; charset=utf-8") | w.Header().Set("Content-Type", "text/json; charset=utf-8") |