소스 검색

envelop body is used for debug purpose only.

master
sp 4 년 전
부모
커밋
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")

Loading…
취소
저장