From 08cb989975c8932af000c938c644fcf4a12ec1e9 Mon Sep 17 00:00:00 2001 From: mountain Date: Tue, 22 Aug 2023 11:10:59 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=9C=EB=B9=84=EC=8A=A4=20json=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/api.go | 2 +- core/service.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/api.go b/core/api.go index da14872..dab0709 100644 --- a/core/api.go +++ b/core/api.go @@ -276,7 +276,7 @@ func (caller apiCaller) serviceAPI(w http.ResponseWriter, r *http.Request) error atomic.StorePointer(&mg.serviceptr, unsafe.Pointer(&newService)) } - w.Write(mg.service().divisionsSerialized) + w.Write(mg.service().serviceSerialized) } else if r.Method == "POST" { body, _ := io.ReadAll(r.Body) var service serviceDescription diff --git a/core/service.go b/core/service.go index c4b3543..9b6d450 100644 --- a/core/service.go +++ b/core/service.go @@ -28,6 +28,7 @@ type blockinfo struct { } type whitelistmember struct { + Id primitive.ObjectID `bson:"_id" json:"_id"` Email string `bson:"email" json:"email"` Platform string `bson:"platform" json:"platform"` Desc string `bson:"desc" json:"desc"` @@ -254,8 +255,9 @@ func (sh *serviceDescription) prepare(mg *Maingate) error { sh.wl = mg.wl sh.bl = mg.bl sh.serviceSummarySerialized, _ = json.Marshal(sh.ServiceDescriptionSummary) + sh.serviceSerialized, _ = json.Marshal(sh) - logger.Println("service is ready :", sh.ServiceCode, string(sh.divisionsSerialized)) + logger.Println("service is ready :", sh.ServiceCode, string(sh.serviceSerialized)) return nil }