Skip to content

Commit

Permalink
fix: 이벤트 얻어오기 파라미터 수정, 게시글 얻어오기 파라미터 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Tentennball committed Aug 1, 2024
1 parent 2439628 commit 4bbd034
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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("로그아웃 성공"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gible/global/util/redis/RedisUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4bbd034

Please sign in to comment.