From 10d1537d9d1e88017545d8f91f27fd7b4369974c Mon Sep 17 00:00:00 2001 From: Suhyeon <70002218+onpyeong@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:24:17 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Fix]:=20=ED=8A=B9=EC=A0=95=EB=82=A0?= =?UTF-8?q?=EC=A7=9C=20=EC=95=BD=20=EC=9D=BC=EC=A0=95=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=20=EC=97=90=EB=9F=AC=20=EC=B2=98=EB=A6=AC=20(#112)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pillSchedule이 자신의 약이 맞는지 체크하도록 수정 특정날짜 약 일정 조회 에러 처리 Related to: #111 --- .../pill/infrastructure/PillScheduleQueryRepository.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/io/sobok/SobokSobok/pill/infrastructure/PillScheduleQueryRepository.java b/src/main/java/io/sobok/SobokSobok/pill/infrastructure/PillScheduleQueryRepository.java index a6f86ce..a8a3b6e 100644 --- a/src/main/java/io/sobok/SobokSobok/pill/infrastructure/PillScheduleQueryRepository.java +++ b/src/main/java/io/sobok/SobokSobok/pill/infrastructure/PillScheduleQueryRepository.java @@ -102,6 +102,7 @@ public List getDateSchedule(Long userId, LocalDate date) { List pillScheduleIds = queryFactory .select(pillSchedule.id) .from(pillSchedule) + .join(pill).on(pill.id.eq(pillSchedule.pillId), pill.userId.eq(userId)) .where(pillSchedule.scheduleDate.eq(date), pillSchedule.scheduleTime.eq(time)) .fetch(); From fdec5e8f36c03b0ae60efd2ec0e4b6ee138d007b Mon Sep 17 00:00:00 2001 From: Lee SeungHeon <51286325+dev-Crayon@users.noreply.github.com> Date: Mon, 11 Mar 2024 23:25:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Fix]:=20=EC=9C=A0=EC=A0=80=20refresh=20tok?= =?UTF-8?q?en=20=EB=B0=9C=EA=B8=89=20=EB=A1=9C=EC=A7=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#115)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Fix]: 유저 refresh token 발급 로직 수정 Authentication 객체 username으로 user 불러오기 Related to: #114 * [Refactor]: AuthService 파일 안쓰는 import 삭제 Related to: #114 --- .../sobok/SobokSobok/auth/application/AuthService.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/sobok/SobokSobok/auth/application/AuthService.java b/src/main/java/io/sobok/SobokSobok/auth/application/AuthService.java index 86b7ba8..ffe2bc3 100644 --- a/src/main/java/io/sobok/SobokSobok/auth/application/AuthService.java +++ b/src/main/java/io/sobok/SobokSobok/auth/application/AuthService.java @@ -6,16 +6,12 @@ import io.sobok.SobokSobok.auth.ui.dto.JwtTokenResponse; import io.sobok.SobokSobok.exception.ErrorCode; import io.sobok.SobokSobok.exception.model.NotFoundException; -import io.sobok.SobokSobok.friend.infrastructure.FriendQueryRepository; import io.sobok.SobokSobok.friend.infrastructure.FriendRepository; import io.sobok.SobokSobok.pill.domain.Pill; -import io.sobok.SobokSobok.pill.infrastructure.PillQueryRepository; import io.sobok.SobokSobok.pill.infrastructure.PillRepository; -import io.sobok.SobokSobok.pill.infrastructure.PillScheduleQueryRepository; import io.sobok.SobokSobok.pill.infrastructure.PillScheduleRepository; import io.sobok.SobokSobok.security.jwt.Jwt; import io.sobok.SobokSobok.security.jwt.JwtProvider; -import io.sobok.SobokSobok.sticker.infrastructure.LikeScheduleQueryRepository; import io.sobok.SobokSobok.sticker.infrastructure.LikeScheduleRepository; import lombok.RequiredArgsConstructor; import org.springframework.data.redis.core.RedisTemplate; @@ -56,8 +52,10 @@ public void logout(Long userId) { public JwtTokenResponse refresh(String token) { Authentication authentication = jwtProvider.getAuthentication(token); - String socialId = authentication.getName(); - + String username = authentication.getName(); + User user = userRepository.findByUsername(username) + .orElseThrow(() -> new NotFoundException(ErrorCode.UNREGISTERED_USER)); + String socialId = user.getSocialInfo().getSocialId(); if (socialId == null) { throw new NotFoundException(ErrorCode.UNREGISTERED_TOKEN); }