From 0c678947cdcdf48e01bba21afc791539b6575b8c Mon Sep 17 00:00:00 2001 From: lmw00 Date: Mon, 22 Jan 2024 11:37:07 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=9D=B4=EB=AF=BC=EC=9A=B0]=20=EC=9A=B4?= =?UTF-8?q?=EC=98=81=ED=88=B4=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 쿠폰 만료시간 안되는 이슈 수정 - 전체 유저 제재 목록을 볼 수 있도록 수정 --- core/api.go | 9 +-------- core/api_coupon.go | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/core/api.go b/core/api.go index 7f3959d..e32e367 100644 --- a/core/api.go +++ b/core/api.go @@ -161,14 +161,7 @@ func (caller apiCaller) uploadAPI(w http.ResponseWriter, r *http.Request) error func (caller apiCaller) blockAPI(w http.ResponseWriter, r *http.Request) error { mg := caller.mg if r.Method == "GET" { - target, ok := gocommon.ReadObjectIDFormValue(r.Form, "accid") - if ok { - json.NewEncoder(w).Encode(mg.bl.all()) - } else if !target.IsZero() { - if blocked, ok := mg.bl.get(target); ok && blocked != nil { - json.NewEncoder(w).Encode(blocked) - } - } + json.NewEncoder(w).Encode(mg.bl.all()) } else if r.Method == "PUT" { body, _ := io.ReadAll(r.Body) diff --git a/core/api_coupon.go b/core/api_coupon.go index 46e690d..8bf12ef 100644 --- a/core/api_coupon.go +++ b/core/api_coupon.go @@ -327,7 +327,7 @@ func useCoupon(mongoClient gocommon.MongoClient, w http.ResponseWriter, r *http. } } - if coupon.Expire > time.Now().Unix() { + if coupon.Expire < time.Now().Unix() { // 쿠폰 만료시간 경과 w.WriteHeader(http.StatusInternalServerError) return