From 4bbd034975a460c85d48e450623a8a78b76a5f03 Mon Sep 17 00:00:00 2001 From: tentenball Date: Thu, 1 Aug 2024 12:04:31 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EC=96=BB?= =?UTF-8?q?=EC=96=B4=EC=98=A4=EA=B8=B0=20=ED=8C=8C=EB=9D=BC=EB=AF=B8?= =?UTF-8?q?=ED=84=B0=20=EC=88=98=EC=A0=95,=20=EA=B2=8C=EC=8B=9C=EA=B8=80?= =?UTF-8?q?=20=EC=96=BB=EC=96=B4=EC=98=A4=EA=B8=B0=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/gible/domain/auth/controller/AuthController.java | 6 +----- .../java/gible/domain/event/controller/EventController.java | 2 +- .../java/gible/domain/post/controller/PostController.java | 3 +-- src/main/java/gible/global/util/redis/RedisUtil.java | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/gible/domain/auth/controller/AuthController.java b/src/main/java/gible/domain/auth/controller/AuthController.java index 9760126..e5e1d0a 100644 --- a/src/main/java/gible/domain/auth/controller/AuthController.java +++ b/src/main/java/gible/domain/auth/controller/AuthController.java @@ -2,9 +2,7 @@ import gible.domain.auth.dto.SignInReq; -import gible.domain.auth.dto.SignInRes; import gible.domain.auth.service.AuthService; -import gible.global.util.cookie.CookieUtil; import gible.domain.security.common.SecurityUserDetails; import gible.global.common.response.SuccessRes; import jakarta.validation.Valid; @@ -13,8 +11,6 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.*; -import java.util.HashMap; -import java.util.Map; @RestController @RequiredArgsConstructor @@ -27,7 +23,7 @@ public ResponseEntity login(@Valid @RequestBody SignInReq signInReq) { return authService.login(signInReq); } - @PostMapping("logout") + @PostMapping("/logout") public ResponseEntity logout(@AuthenticationPrincipal SecurityUserDetails userDetails){ authService.logout(userDetails.getId()); return ResponseEntity.ok(SuccessRes.from("로그아웃 성공")); diff --git a/src/main/java/gible/domain/event/controller/EventController.java b/src/main/java/gible/domain/event/controller/EventController.java index 0433f7c..8b639d5 100644 --- a/src/main/java/gible/domain/event/controller/EventController.java +++ b/src/main/java/gible/domain/event/controller/EventController.java @@ -33,7 +33,7 @@ public ResponseEntity saveEvent(@Valid @RequestBody EventReq eventReq) { /* 이벤트 목록 조회 */ @GetMapping public ResponseEntity getAllEvents( - @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable, + @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC, size = 12) Pageable pageable, @RequestParam(name = "region", required = false) Region region) { if (region == null) diff --git a/src/main/java/gible/domain/post/controller/PostController.java b/src/main/java/gible/domain/post/controller/PostController.java index 7cd80af..fab33d8 100644 --- a/src/main/java/gible/domain/post/controller/PostController.java +++ b/src/main/java/gible/domain/post/controller/PostController.java @@ -34,9 +34,8 @@ public ResponseEntity savePost(@Valid @RequestBody PostReq postReq, /* 게시글 목록 조회 + 검색 조회 */ @GetMapping public ResponseEntity getAllPosts( - @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable, + @PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC, size = 12) Pageable pageable, @RequestParam(name = "search", required = false) String search) { - if (search == null) return ResponseEntity.ok().body(postService.getAllPosts(pageable)); diff --git a/src/main/java/gible/global/util/redis/RedisUtil.java b/src/main/java/gible/global/util/redis/RedisUtil.java index 6dae264..dec6ed4 100644 --- a/src/main/java/gible/global/util/redis/RedisUtil.java +++ b/src/main/java/gible/global/util/redis/RedisUtil.java @@ -21,7 +21,7 @@ public void saveExpire(String key, Long seconds){ } public boolean get(String key){ - return redisTemplate.opsForValue().get(key) == null; + return redisTemplate.opsForValue().get(key) != null; } public void delete(String userId) {