[이민우] 운영툴 개선
- 쿠폰 만료시간 안되는 이슈 수정 - 전체 유저 제재 목록을 볼 수 있도록 수정
This commit is contained in:
@ -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)
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user