Sfoglia il codice sorgente

add ext , map to the response template.

master
sp 4 anni fa
parent
commit
82b57f71eb
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. +4
    -0
      apiv1.go

+ 4
- 0
apiv1.go Vedi File

@@ -28,6 +28,8 @@ type apiV1Envelop struct {
type apiV1Response struct {
Env apiV1Envelop
Body interface{}
Ext interface{}
Map map[string]interface{}
}

var apiV1Handler = []apiV1HandlerMap{
@@ -58,6 +60,7 @@ func apiV1Login(w http.ResponseWriter, r *http.Request) {

res := apiV1ResponseBlank()
res.Body = p
res.Map["some"] = p
apiSendJson(res, w)

}
@@ -97,5 +100,6 @@ func apiV1EnvelopBlank() (ret apiV1Envelop) {

func apiV1ResponseBlank() (ret apiV1Response) {
ret.Env = apiV1EnvelopBlank()
ret.Map = make(map[string]interface{})
return
}

Loading…
Annulla
Salva