From 82b57f71eb31f5e7141cbd4d4c98a7c7213af91d Mon Sep 17 00:00:00 2001 From: sp Date: Fri, 26 Feb 2021 01:48:01 +1100 Subject: [PATCH] add ext , map to the response template. --- apiv1.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apiv1.go b/apiv1.go index 5e90e17..bc93dab 100644 --- a/apiv1.go +++ b/apiv1.go @@ -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 }