From 0333a3c92b6daaff913c749409bea15c4e434b86 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Thu, 7 Mar 2024 00:20:20 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=93=9D=20docs:=20ignore=20=EB=A1=9C?= =?UTF-8?q?=EA=B9=85=20=ED=8C=8C=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c092fd2f..9b324236 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ motivoo-firebase-adminsdk.json **.http **.sql +logback-**.xml local.properties From eba5b7a2e7634d42627be0fbb20852a4ce2cf07b Mon Sep 17 00:00:00 2001 From: jun02160 Date: Thu, 7 Mar 2024 00:21:17 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20fix:=20=EB=A7=A4?= =?UTF-8?q?=EC=B9=AD=EB=90=9C=20=EC=9C=A0=EC=A0=80=EA=B0=80=20=ED=83=88?= =?UTF-8?q?=ED=87=B4=ED=95=98=EB=8A=94=20=EA=B2=BD=EC=9A=B0=EC=97=90=20?= =?UTF-8?q?=EB=8C=80=ED=95=9C=20HTTP=20Status=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/motivoo/domain/user/exception/UserExceptionType.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/user/exception/UserExceptionType.java b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/user/exception/UserExceptionType.java index 1acb6ffe..66776e2b 100644 --- a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/user/exception/UserExceptionType.java +++ b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/user/exception/UserExceptionType.java @@ -17,7 +17,6 @@ public enum UserExceptionType implements BusinessExceptionType { NULL_VALUE_USERTYPE_ENUM(HttpStatus.BAD_REQUEST, "데이터베이스의 유저 타입이 유효하지 않은 값입니다."), NULL_VALUE_AGE(HttpStatus.BAD_REQUEST, "유저의 나이는 null이어서는 안 됩니다."), ALREADY_WITHDRAW_USER(HttpStatus.BAD_REQUEST, "이미 탈퇴한 유저입니다."), - ALREADY_WITHDRAW_OPPONENT_USER(HttpStatus.BAD_REQUEST, "상대 유저가 탈퇴하여 요청을 처리할 수 없습니다."), /** * 401 Unauthorized @@ -36,7 +35,7 @@ public enum UserExceptionType implements BusinessExceptionType { /** * 412 Precondition Failed */ - // ALREADY_WITHDRAW_OPPONENT_USER(HttpStatus.PRECONDITION_FAILED, "상대 유저가 탈퇴하여 요청을 처리할 수 없습니다."), + ALREADY_WITHDRAW_OPPONENT_USER(HttpStatus.PRECONDITION_FAILED, "상대 유저가 탈퇴하여 요청을 처리할 수 없습니다."), ; From 027d171fa09a86813a437f17c32cfd79d2253f39 Mon Sep 17 00:00:00 2001 From: jun02160 Date: Thu, 7 Mar 2024 00:21:39 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=9A=91=20hotfix:=20=EB=B9=84=EA=B4=80?= =?UTF-8?q?=EC=A0=81=20=EB=9D=BD=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= =?UTF-8?q?=20#133?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sopt/org/motivoo/domain/mission/entity/UserMission.java | 4 ++++ .../domain/mission/repository/UserMissionRepository.java | 4 ++-- .../domain/mission/repository/UserMissionRetriever.java | 2 +- .../motivoo/domain/mission/service/UserMissionManager.java | 6 ++++++ .../motivoo/domain/mission/service/UserMissionService.java | 3 ++- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/entity/UserMission.java b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/entity/UserMission.java index 399f5049..67d7b2bb 100644 --- a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/entity/UserMission.java +++ b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/entity/UserMission.java @@ -120,6 +120,10 @@ public void updateMissionFromEmpty(final Mission mission) { this.updateCompletedStatus(IN_PROGRESS); } + public void updateMissionQuest(MissionQuest missionQuest) { + this.missionQuest = missionQuest; + } + public boolean isEmptyUserMission() { return this.getMission().getTarget().equals(UserType.NONE); } diff --git a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/repository/UserMissionRepository.java b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/repository/UserMissionRepository.java index fe5f5ddc..0860b9b2 100644 --- a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/repository/UserMissionRepository.java +++ b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/repository/UserMissionRepository.java @@ -39,7 +39,7 @@ public interface UserMissionRepository extends JpaRepository //== UPDATE ==// @Modifying - @Query("UPDATE UserMission um SET um.mission = :mission, um.missionQuest = :quest, um.completedStatus = :status WHERE um.user = :user AND DATE(um.createdAt) = DATE(:date)") - void updateValidTodayMission(Mission mission, MissionQuest quest, CompletedStatus status, User user, LocalDate date); + @Query("UPDATE UserMission um SET um.mission = :mission, um.missionQuest = :quest WHERE um.user = :user AND DATE(um.createdAt) = DATE(:date)") + void updateValidTodayMission(Mission mission, MissionQuest quest, User user, LocalDate date); } diff --git a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/repository/UserMissionRetriever.java b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/repository/UserMissionRetriever.java index 2f947892..e812401c 100644 --- a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/repository/UserMissionRetriever.java +++ b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/repository/UserMissionRetriever.java @@ -52,7 +52,7 @@ public void deleteById(Long userMissionId) { //== UPDATE ==// public void updateUserMission(User user, Mission mission, MissionQuest quest) { - userMissionRepository.updateValidTodayMission(mission, quest, IN_PROGRESS, user, LocalDate.now()); + userMissionRepository.updateValidTodayMission(mission, quest, user, LocalDate.now()); } //== CREATE ==// diff --git a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/service/UserMissionManager.java b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/service/UserMissionManager.java index 220a8d6b..83866d08 100644 --- a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/service/UserMissionManager.java +++ b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/mission/service/UserMissionManager.java @@ -172,6 +172,12 @@ public List getFilteredMissionChoices(User user, List Date: Thu, 7 Mar 2024 00:29:27 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=90=9B=20bugfix:=20=EB=B6=80=EB=AA=A8?= =?UTF-8?q?=EC=9E=90=EB=85=80=20=EB=A7=A4=EC=B9=AD=20=EC=8B=9C=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=20=EC=B6=94=EA=B0=80=20#133?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/parentchild/entity/Parentchild.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/parentchild/entity/Parentchild.java b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/parentchild/entity/Parentchild.java index 4edb2b05..84de4794 100644 --- a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/parentchild/entity/Parentchild.java +++ b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/parentchild/entity/Parentchild.java @@ -1,5 +1,7 @@ package sopt.org.motivoo.domain.parentchild.entity; +import static sopt.org.motivoo.domain.parentchild.exception.ParentchildExceptionType.*; + import java.util.List; import jakarta.persistence.Column; @@ -12,6 +14,8 @@ import lombok.Getter; import lombok.NoArgsConstructor; import sopt.org.motivoo.domain.common.BaseTimeEntity; +import sopt.org.motivoo.domain.parentchild.exception.ParentchildException; +import sopt.org.motivoo.domain.parentchild.exception.ParentchildExceptionType; import sopt.org.motivoo.domain.user.entity.User; @Getter @@ -43,10 +47,9 @@ public void matchingSuccess() { public boolean validateParentchild(int userCnt) { // 부모자식 관계에 대한 예외처리 - if (userCnt != 2) { - return false; + if (userCnt >= 3) { + throw new ParentchildException(INVALID_PARENTCHILD_RELATION); } - - return true; + return userCnt == 2 && isMatched; } }