diff --git a/src/main/java/org/sopt/app/application/poke/PokeHistoryService.java b/src/main/java/org/sopt/app/application/poke/PokeHistoryService.java index 651af213..e51f53f0 100644 --- a/src/main/java/org/sopt/app/application/poke/PokeHistoryService.java +++ b/src/main/java/org/sopt/app/application/poke/PokeHistoryService.java @@ -22,10 +22,6 @@ public class PokeHistoryService { private final PokeHistoryRepository pokeHistoryRepository; - public Boolean isNewPoker(Long userId) { - return pokeHistoryRepository.findAllByPokerId(userId).isEmpty(); - } - public List getAllOfPokeBetween(Long userId, Long friendId) { return pokeHistoryRepository.findAllWithFriendOrderByCreatedAtDesc(userId, friendId); } diff --git a/src/main/java/org/sopt/app/presentation/poke/PokeController.java b/src/main/java/org/sopt/app/presentation/poke/PokeController.java index 329c1419..2b427c3a 100644 --- a/src/main/java/org/sopt/app/presentation/poke/PokeController.java +++ b/src/main/java/org/sopt/app/presentation/poke/PokeController.java @@ -8,6 +8,7 @@ import lombok.RequiredArgsConstructor; import lombok.val; +import org.sopt.app.application.poke.FriendService; import org.sopt.app.application.poke.PokeHistoryService; import org.sopt.app.domain.entity.User; import org.sopt.app.domain.enums.Friendship; @@ -34,7 +35,7 @@ public class PokeController { private final PokeFacade pokeFacade; - private final PokeHistoryService pokeHistoryService; + private final FriendService friendService; @GetMapping("/random-user") public ResponseEntity> getRandomUserForNew( @@ -52,8 +53,8 @@ public ResponseEntity> getRandomUserForNew( public ResponseEntity getPokeList( @AuthenticationPrincipal User user ) { - val result = pokeHistoryService.isNewPoker(user.getId()); - val response = PokeResponse.IsNew.of(result); + val result = friendService.getPokeFriendIdRandomly(user.getId()); + val response = PokeResponse.IsNew.of(result.isEmpty()); return ResponseEntity.ok(response); }