ソースを参照

envelop body is used for debug purpose only.

master
sp 5年前
コミット
612421221d
1個のファイルの変更6行の追加3行の削除
  1. +6
    -3
      apiV1Response.go

+ 6
- 3
apiV1Response.go ファイルの表示

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")

読み込み中…
キャンセル
保存