From 646a6aeaef7d1956f0fc6885ce36d338425e8f94 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Sat, 15 Jul 2023 16:34:18 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[FIX]=20Parentchild=20=EC=97=94=ED=8B=B0?= =?UTF-8?q?=ED=8B=B0=EC=9D=98=20qnaList=20=EC=B4=88=EA=B8=B0=ED=99=94=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=9E=91=EC=84=B1=20#43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../umbbaServer/domain/parentchild/dao/ParentchildDao.java | 1 + .../umbbaServer/domain/parentchild/model/Parentchild.java | 4 ++++ .../org/umbbaServer/domain/qna/service/QnAService.java | 7 +++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/dao/ParentchildDao.java b/src/main/java/sopt/org/umbbaServer/domain/parentchild/dao/ParentchildDao.java index 7430daa1..19ad94b7 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/dao/ParentchildDao.java +++ b/src/main/java/sopt/org/umbbaServer/domain/parentchild/dao/ParentchildDao.java @@ -28,6 +28,7 @@ public Optional findByUserId(Long userId) { .setParameter("id", userId) .getSingleResult(); return Optional.ofNullable(parentchild); + } catch (NoResultException e) { return Optional.empty(); } diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/model/Parentchild.java b/src/main/java/sopt/org/umbbaServer/domain/parentchild/model/Parentchild.java index da0ab1df..4af04229 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/model/Parentchild.java +++ b/src/main/java/sopt/org/umbbaServer/domain/parentchild/model/Parentchild.java @@ -56,6 +56,10 @@ public void changeParentOnboardingAnswerList(List onboardingAn @Column(nullable = false) private LocalTime pushTime; // default: 오후 11시(클라이언트) + public void initQnA() { + qnaList = new ArrayList<>(); + } + public void addQnA(QnA qnA) { qnaList.add(qnA); } diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java b/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java index b1238609..0be50143 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java +++ b/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java @@ -128,6 +128,7 @@ public void filterFirstQuestion(Long userId, List onboardingAn .build(); qnARepository.save(newQnA); + parentchild.initQnA(); parentchild.addQnA(newQnA); } @@ -182,8 +183,10 @@ private Parentchild getParentchildByUser(User user) { } private Parentchild getParentchildByUserId(Long userId) { - return parentchildDao.findByUserId(userId) - .orElseThrow(() -> new CustomException(ErrorType.USER_HAVE_NO_PARENTCHILD)); + + return parentchildDao.findByUserId(userId).orElseThrow( + () -> new CustomException(ErrorType.USER_HAVE_NO_PARENTCHILD) + ); } private List getQnAListByParentchild(Parentchild parentchild) { From 1b5252fbd7ce16626da1d6a6fe267d8ec3379dcd Mon Sep 17 00:00:00 2001 From: ddongseop Date: Sat, 15 Jul 2023 17:04:08 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[FIX]=20=ED=91=B8=EC=8B=9C=20=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=20=EC=8B=9C=EA=B0=84=EC=9D=B4=2023:00:00=20=ED=98=95?= =?UTF-8?q?=EC=8B=9D=EC=9C=BC=EB=A1=9C=20=EB=A6=AC=ED=84=B4=EB=90=98?= =?UTF-8?q?=EB=8A=94=20=EA=B2=83=2023:00=EC=9C=BC=EB=A1=9C=20=EB=A6=AC?= =?UTF-8?q?=ED=84=B4=EB=90=98=EA=B2=8C=20=EC=88=98=EC=A0=95=20#43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/dto/response/OnboardingInviteResponseDto.java | 2 ++ .../controller/dto/response/OnboardingReceiveResponseDto.java | 2 ++ .../sopt/org/umbbaServer/domain/user/service/AuthService.java | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java b/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java index e4b8d231..c8fa6b37 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java +++ b/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingInviteResponseDto.java @@ -1,5 +1,6 @@ package sopt.org.umbbaServer.domain.parentchild.controller.dto.response; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; @@ -21,6 +22,7 @@ public class OnboardingInviteResponseDto { private String parentchildRelation; + @JsonFormat(pattern = "kk:mm") private LocalTime pushTime; private String inviteCode; diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java b/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java index ae721c34..91c52cf2 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java +++ b/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/response/OnboardingReceiveResponseDto.java @@ -1,5 +1,6 @@ package sopt.org.umbbaServer.domain.parentchild.controller.dto.response; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.Builder; @@ -20,6 +21,7 @@ public class OnboardingReceiveResponseDto { private InviteResultResponseDto parentchildInfo; + @JsonFormat(pattern = "kk:mm") private LocalTime pushTime; public static OnboardingReceiveResponseDto of(Parentchild parentchild, User user, List parentChildUsers) { diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/service/AuthService.java b/src/main/java/sopt/org/umbbaServer/domain/user/service/AuthService.java index d1f41562..98ca1153 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/service/AuthService.java +++ b/src/main/java/sopt/org/umbbaServer/domain/user/service/AuthService.java @@ -110,7 +110,7 @@ private boolean isUserBySocialAndSocialId(SocialPlatform socialPlatform, String return userRepository.existsBySocialPlatformAndSocialId(socialPlatform, socialId); } - private String login(SocialPlatform socialPlatform, String socialAccessToken) throws NoSuchAlgorithmException, InvalidKeySpecException { + private String login(SocialPlatform socialPlatform, String socialAccessToken) { try { switch (socialPlatform.toString()) { From 359f476a7f11bb9379fd36aff27e21d78dc5f1b0 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Sat, 15 Jul 2023 17:57:01 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[FIX]=20=EC=B4=88=EB=8C=80=20=EB=B0=9B?= =?UTF-8?q?=EB=8A=94=20=EC=9E=85=EC=9E=A5=EC=97=90=EC=84=9C=20parentchild?= =?UTF-8?q?=5Fid=20=EC=95=88=EB=B0=9B=EA=B2=8C=20=EB=B3=80=EA=B2=BD=20+=20?= =?UTF-8?q?YES,=20NO=EA=B0=80=20=EC=95=84=EB=8B=88=EB=9D=BC=20=EC=9D=91,?= =?UTF-8?q?=20=EC=95=84=EB=8B=88=EB=A1=9C=20=EC=84=A0=ED=83=9D=EC=A7=88?= =?UTF-8?q?=EB=AC=B8=20=EB=8B=B5=EB=B3=80=20=EB=B0=9B=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20#43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/OnboardingInviteRequestDto.java | 5 +++-- .../request/OnboardingReceiveRequestDto.java | 9 +++------ .../service/ParentchildService.java | 19 ++++++++----------- .../domain/qna/model/OnboardingAnswer.java | 14 +++++++++++++- .../domain/qna/service/QnAService.java | 17 +++++++++++++++-- .../global/exception/ErrorType.java | 1 + 6 files changed, 43 insertions(+), 22 deletions(-) diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java b/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java index 8c187bbd..f9a67f7a 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java +++ b/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingInviteRequestDto.java @@ -8,10 +8,10 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; -import sopt.org.umbbaServer.domain.qna.model.OnboardingAnswer; import sopt.org.umbbaServer.domain.user.controller.dto.request.UserInfoDto; import javax.validation.Valid; +import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.time.LocalTime; import java.util.List; @@ -34,5 +34,6 @@ public class OnboardingInviteRequestDto { @JsonFormat(pattern = "kk:mm") private LocalTime pushTime; - private List onboardingAnswerList; + @NotEmpty // TODO 여기서 걸러지게 만들어야함 + private List onboardingAnswerList; } diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java b/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java index 7e720765..15f99d24 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java +++ b/src/main/java/sopt/org/umbbaServer/domain/parentchild/controller/dto/request/OnboardingReceiveRequestDto.java @@ -5,11 +5,10 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; -import lombok.NonNull; -import sopt.org.umbbaServer.domain.qna.model.OnboardingAnswer; import sopt.org.umbbaServer.domain.user.controller.dto.request.UserInfoDto; import javax.validation.Valid; +import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.List; @@ -18,12 +17,10 @@ @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) public class OnboardingReceiveRequestDto { - @NonNull - private Long parentChildId; - @NotNull @Valid private UserInfoDto userInfo; - private List onboardingAnswerList; + @NotEmpty + private List onboardingAnswerList; } diff --git a/src/main/java/sopt/org/umbbaServer/domain/parentchild/service/ParentchildService.java b/src/main/java/sopt/org/umbbaServer/domain/parentchild/service/ParentchildService.java index c69a1b96..da663bbf 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/parentchild/service/ParentchildService.java +++ b/src/main/java/sopt/org/umbbaServer/domain/parentchild/service/ParentchildService.java @@ -29,10 +29,9 @@ @Transactional(readOnly = true) public class ParentchildService { - private final ParentchildDao parentchildDao; private final ParentchildRepository parentchildRepository; private final UserRepository userRepository; - private final QnADao qnADao; + private final ParentchildDao parentchildDao; // [발신] 초대하는 측의 온보딩 정보 입력 @Transactional @@ -72,9 +71,7 @@ public OnboardingReceiveResponseDto onboardReceive(Long userId, OnboardingReceiv request.getUserInfo().getBornYear() ); - // TODO 추가 질문 답변 저장 - Parentchild parentchild = getParentchildById(request.getParentChildId()); - + Parentchild parentchild = getParentchildByUserId(userId); // parentchild.updateInfo(); List parentChildUsers = getParentChildUsers(parentchild); @@ -153,7 +150,7 @@ private List getParentChildUsers(Parentchild newMatchRelation) { log.info("성립된 부모자식: {} X {}, 관계: {}", parentChildUsers.get(0).getUsername(), parentChildUsers.get(1).getUsername(), newMatchRelation.getRelation()); // 부모자식 관계에 대한 예외처리 - if (parentChildUsers.isEmpty() || parentChildUsers == null) { + if (parentChildUsers.isEmpty()) { throw new CustomException(ErrorType.NOT_EXIST_PARENT_CHILD_USER); } @@ -167,18 +164,18 @@ private List getParentChildUsers(Parentchild newMatchRelation) { } + private Parentchild getParentchildByUserId(Long userId) { - private Parentchild getParentchildById(Long parentchildId) { - return parentchildRepository.findById(parentchildId).orElseThrow( - () -> new CustomException(ErrorType.NOT_EXIST_PARENT_CHILD_RELATION) + return parentchildDao.findByUserId(userId).orElseThrow( + () -> new CustomException(ErrorType.USER_HAVE_NO_PARENTCHILD) ); } private User getUserById(Long userId) { - User user = userRepository.findById(userId).orElseThrow( + + return userRepository.findById(userId).orElseThrow( () -> new CustomException(ErrorType.INVALID_USER) ); - return user; } } diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/model/OnboardingAnswer.java b/src/main/java/sopt/org/umbbaServer/domain/qna/model/OnboardingAnswer.java index 2129c2a9..ab604828 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/model/OnboardingAnswer.java +++ b/src/main/java/sopt/org/umbbaServer/domain/qna/model/OnboardingAnswer.java @@ -3,6 +3,8 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; +import sopt.org.umbbaServer.global.exception.CustomException; +import sopt.org.umbbaServer.global.exception.ErrorType; @Getter @RequiredArgsConstructor(access = AccessLevel.PRIVATE) @@ -10,7 +12,17 @@ public enum OnboardingAnswer { YES("응"), NO("아니"), - SKIP("잘 모르겠어"); + SKIP("애매해"); private final String value; + + public static OnboardingAnswer of(String value) { + for (OnboardingAnswer answer : OnboardingAnswer.values()) { + if (answer.getValue().equals(value)) { + return answer; + } + } + throw new CustomException(ErrorType.INVALID_ONBOARDING_ANSWER); + } + } diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java b/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java index 0be50143..8c7fa1e9 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java +++ b/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java @@ -21,6 +21,7 @@ import sopt.org.umbbaServer.global.exception.CustomException; import sopt.org.umbbaServer.global.exception.ErrorType; +import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.Optional; @@ -110,10 +111,15 @@ public SingleQnAResponseDto getSingleQna(Long userId, Long qnaId) { } @Transactional - public void filterFirstQuestion(Long userId, List onboardingAnswerList) { + public void filterFirstQuestion(Long userId, List onboardingAnswerStringList) { Parentchild parentchild = getParentchildByUserId(userId); + // String을 Enum으로 변경 + List onboardingAnswerList = onboardingAnswerStringList.stream() + .map(OnboardingAnswer::of) + .collect(Collectors.toList()); + if (getUserById(userId).isMeChild()) { parentchild.changeChildOnboardingAnswerList(onboardingAnswerList); } else { @@ -133,10 +139,15 @@ public void filterFirstQuestion(Long userId, List onboardingAn } @Transactional - public void filterAllQuestion(Long userId, List onboardingAnswerList) { + public void filterAllQuestion(Long userId, List onboardingAnswerStringList) { Parentchild parentchild = getParentchildByUserId(userId); + // String을 Enum으로 변경 + List onboardingAnswerList = onboardingAnswerStringList.stream() + .map(OnboardingAnswer::of) + .collect(Collectors.toList()); + if (getUserById(userId).isMeChild()) { parentchild.changeChildOnboardingAnswerList(onboardingAnswerList); } else { @@ -146,7 +157,9 @@ public void filterAllQuestion(Long userId, List onboardingAnsw List childList = parentchild.getChildOnboardingAnswerList(); List parentList = parentchild.getParentOnboardingAnswerList(); + // 질문 그룹을 선택 QuestionGroup selectedGroup = selectGroup(childList, parentList); + System.out.println("선택된 그룹: " + selectedGroup); for (QuestionSection section : QuestionSection.values()) { if (section == YOUNG) continue; diff --git a/src/main/java/sopt/org/umbbaServer/global/exception/ErrorType.java b/src/main/java/sopt/org/umbbaServer/global/exception/ErrorType.java index fd8b1ed9..c9a57ca7 100644 --- a/src/main/java/sopt/org/umbbaServer/global/exception/ErrorType.java +++ b/src/main/java/sopt/org/umbbaServer/global/exception/ErrorType.java @@ -17,6 +17,7 @@ public enum ErrorType { HEADER_REQUEST_MISSING_EXCEPTION(HttpStatus.BAD_REQUEST, "요청에 필요한 헤더값이 존재하지 않습니다."), VALIDATION_WRONG_ENUM_EXCEPTION(HttpStatus.BAD_REQUEST, "허용되지 않는 문자열이 입력되었습니다."), INVALID_SOCIAL_PLATFORM(HttpStatus.BAD_REQUEST, "유효하지 않은 소셜 플랫폼입니다."), + INVALID_ONBOARDING_ANSWER(HttpStatus.BAD_REQUEST, "유효하지 않은 선택질문 응답값입니다."), // ParentChild - Onboarding INVALID_PARENT_CHILD_RELATION_INFO(HttpStatus.BAD_REQUEST, "부모자식 관계를 정의할 수 없는 요청값입니다."), From c5528c3e87f8940422af72451c2aa4bede31d9e1 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Sat, 15 Jul 2023 18:00:27 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[FIX]=20request=20dto=EC=9D=98=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=EB=AA=85=EC=9D=B4=20snake=5Fcase=EB=A1=9C=20=EB=B0=9B?= =?UTF-8?q?=EC=95=84=EC=99=80=EC=A7=80=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20#43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qna/controller/dto/request/TodayAnswerRequestDto.java | 3 +++ .../domain/user/controller/dto/request/RefreshRequestDto.java | 3 +++ .../user/controller/dto/request/SocialLoginRequestDto.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/request/TodayAnswerRequestDto.java b/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/request/TodayAnswerRequestDto.java index 13d51a20..57a4646e 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/request/TodayAnswerRequestDto.java +++ b/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/request/TodayAnswerRequestDto.java @@ -1,5 +1,7 @@ package sopt.org.umbbaServer.domain.qna.controller.dto.request; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @@ -8,6 +10,7 @@ @Getter @NoArgsConstructor(access = AccessLevel.PRIVATE) +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) public class TodayAnswerRequestDto { @NotBlank // null, "", " "을 모두 허용하지 X diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/RefreshRequestDto.java b/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/RefreshRequestDto.java index aced3501..a0551ba5 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/RefreshRequestDto.java +++ b/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/RefreshRequestDto.java @@ -1,11 +1,14 @@ package sopt.org.umbbaServer.domain.user.controller.dto.request; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @Getter @NoArgsConstructor(access = AccessLevel.PRIVATE) +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) public class RefreshRequestDto { private Long userId; diff --git a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/SocialLoginRequestDto.java b/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/SocialLoginRequestDto.java index 20528c37..97ec3560 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/SocialLoginRequestDto.java +++ b/src/main/java/sopt/org/umbbaServer/domain/user/controller/dto/request/SocialLoginRequestDto.java @@ -1,5 +1,7 @@ package sopt.org.umbbaServer.domain.user.controller.dto.request; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @@ -7,6 +9,7 @@ @Getter @NoArgsConstructor(access = AccessLevel.PRIVATE) +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) public class SocialLoginRequestDto { private SocialPlatform socialPlatform; From a25b8ae8677533649f91ef1d4563685d4a166d3a Mon Sep 17 00:00:00 2001 From: ddongseop Date: Sat, 15 Jul 2023 18:12:52 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[FIX]=20=EA=B3=BC=EA=B1=B0=EC=9D=98=20?= =?UTF-8?q?=EB=AC=B8=EB=8B=B5=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=ED=95=98=EA=B8=B0=20=EC=A7=88=EB=AC=B8=EC=9D=B4=20?= =?UTF-8?q?=EC=95=84=EB=8B=88=EB=9D=BC=20=EC=A3=BC=EC=A0=9C=20=EB=B3=B4?= =?UTF-8?q?=EC=97=AC=EC=A3=BC=EB=8A=94=EA=B1=B8=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20#43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/qna/controller/dto/response/QnAListResponseDto.java | 2 +- .../sopt/org/umbbaServer/domain/qna/service/QnAService.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/QnAListResponseDto.java b/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/QnAListResponseDto.java index 8bfe14f3..a5d65dd8 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/QnAListResponseDto.java +++ b/src/main/java/sopt/org/umbbaServer/domain/qna/controller/dto/response/QnAListResponseDto.java @@ -12,5 +12,5 @@ public class QnAListResponseDto { private Long qnaId; private Integer index; - private String question; + private String topic; } diff --git a/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java b/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java index 8c7fa1e9..b9474911 100644 --- a/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java +++ b/src/main/java/sopt/org/umbbaServer/domain/qna/service/QnAService.java @@ -90,11 +90,10 @@ public List getQnaList(Long userId, Long sectionId) { return qnaList.stream() .filter(qna -> Objects.equals(qna.getQuestion().getSection().getSectionId(), sectionId)) .map(qna -> { - String question = myUser.isMeChild() ? qna.getQuestion().getChildQuestion() : qna.getQuestion().getParentQuestion(); return QnAListResponseDto.builder() .qnaId(qna.getId()) .index(qnaList.indexOf(qna) + 1) - .question(question) + .topic(qna.getQuestion().getTopic()) .build(); }) .collect(Collectors.toList());