From fa062bd45e08652f9034aa923d4bbf2f11e11719 Mon Sep 17 00:00:00 2001 From: chjcoder Date: Sun, 6 Oct 2024 17:05:27 +0900 Subject: [PATCH] =?UTF-8?q?fix(conflict)=20:=20merge=EA=B3=BC=EC=A0=95?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=9E=88=EC=97=88=EB=8D=98=20conflict=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grassdiary/domain/diary/service/GrassCountService.java | 2 +- .../java/chzzk/grassdiary/domain/member/entity/Member.java | 2 +- .../domain/member/entity/MemberPurchasedColor.java | 2 +- .../domain/member/entity/MemberPurchasedColorDAO.java | 2 ++ .../domain/member/service/MemberPurchasedColorService.java | 6 +++--- .../grassdiary/global/common/response/ClientErrorCode.java | 1 + .../domain/diary/service/BrowseDiaryServiceTest.java | 4 ++-- .../grassdiary/domain/member/service/MemberServiceTest.java | 2 +- 8 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/chzzk/grassdiary/domain/diary/service/GrassCountService.java b/src/main/java/chzzk/grassdiary/domain/diary/service/GrassCountService.java index a10fab37..678fef5b 100644 --- a/src/main/java/chzzk/grassdiary/domain/diary/service/GrassCountService.java +++ b/src/main/java/chzzk/grassdiary/domain/diary/service/GrassCountService.java @@ -6,7 +6,7 @@ import chzzk.grassdiary.domain.member.dto.GrassInfoDTO; import chzzk.grassdiary.domain.member.entity.Member; import chzzk.grassdiary.domain.member.entity.MemberDAO; -import chzzk.grassdiary.domain.color.ColorCode; +import chzzk.grassdiary.domain.color.entity.ColorCode; import chzzk.grassdiary.global.common.error.exception.SystemException; import chzzk.grassdiary.global.common.response.ClientErrorCode; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/chzzk/grassdiary/domain/member/entity/Member.java b/src/main/java/chzzk/grassdiary/domain/member/entity/Member.java index 4c6c664c..7a8bf6d3 100644 --- a/src/main/java/chzzk/grassdiary/domain/member/entity/Member.java +++ b/src/main/java/chzzk/grassdiary/domain/member/entity/Member.java @@ -103,7 +103,7 @@ public void withdrawMember() { this.email = "withdrawnMember"; this.profileIntro = null; this.picture = null; - + } public void deductRewardPoints(int points) { if (this.rewardPoint < points) { throw new SystemException(ClientErrorCode.INSUFFICIENT_REWARD_POINTS_ERR); diff --git a/src/main/java/chzzk/grassdiary/domain/member/entity/MemberPurchasedColor.java b/src/main/java/chzzk/grassdiary/domain/member/entity/MemberPurchasedColor.java index 66f457ae..234a3317 100644 --- a/src/main/java/chzzk/grassdiary/domain/member/entity/MemberPurchasedColor.java +++ b/src/main/java/chzzk/grassdiary/domain/member/entity/MemberPurchasedColor.java @@ -1,7 +1,7 @@ package chzzk.grassdiary.domain.member.entity; import chzzk.grassdiary.domain.base.BaseCreatedTimeEntity; -import chzzk.grassdiary.domain.color.ColorCode; +import chzzk.grassdiary.domain.color.entity.ColorCode; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; diff --git a/src/main/java/chzzk/grassdiary/domain/member/entity/MemberPurchasedColorDAO.java b/src/main/java/chzzk/grassdiary/domain/member/entity/MemberPurchasedColorDAO.java index 00859a97..b67b2fd9 100644 --- a/src/main/java/chzzk/grassdiary/domain/member/entity/MemberPurchasedColorDAO.java +++ b/src/main/java/chzzk/grassdiary/domain/member/entity/MemberPurchasedColorDAO.java @@ -1,7 +1,9 @@ package chzzk.grassdiary.domain.member.entity; +import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; public interface MemberPurchasedColorDAO extends JpaRepository { boolean existsByColorCodeIdAndMemberId(Long memberId, Long colorCodeId); + List findAllByMemberId(Long memberId); } diff --git a/src/main/java/chzzk/grassdiary/domain/member/service/MemberPurchasedColorService.java b/src/main/java/chzzk/grassdiary/domain/member/service/MemberPurchasedColorService.java index 421e94ff..d866fb06 100644 --- a/src/main/java/chzzk/grassdiary/domain/member/service/MemberPurchasedColorService.java +++ b/src/main/java/chzzk/grassdiary/domain/member/service/MemberPurchasedColorService.java @@ -1,7 +1,7 @@ package chzzk.grassdiary.domain.member.service; -import chzzk.grassdiary.domain.color.ColorCode; -import chzzk.grassdiary.domain.color.ColorCodeDAO; +import chzzk.grassdiary.domain.color.entity.ColorCode; +import chzzk.grassdiary.domain.color.entity.ColorCodeDAO; import chzzk.grassdiary.domain.member.dto.MemberPurchasedColorResponseDTO; import chzzk.grassdiary.domain.member.entity.Member; import chzzk.grassdiary.domain.member.entity.MemberDAO; @@ -34,7 +34,7 @@ public MemberPurchasedColorResponseDTO purchaseColor(Long colorCodeId, Long logI saveRewardHistory(member, colorCode); MemberPurchasedColor memberPurchasedColor = registerPurchase(member, colorCode); - return new MemberPurchasedColorResponseDTO(memberPurchasedColor); + return MemberPurchasedColorResponseDTO.from(memberPurchasedColor); } private Member getMemberById(Long id) { diff --git a/src/main/java/chzzk/grassdiary/global/common/response/ClientErrorCode.java b/src/main/java/chzzk/grassdiary/global/common/response/ClientErrorCode.java index 507e226e..5b51ff93 100644 --- a/src/main/java/chzzk/grassdiary/global/common/response/ClientErrorCode.java +++ b/src/main/java/chzzk/grassdiary/global/common/response/ClientErrorCode.java @@ -32,6 +32,7 @@ public enum ClientErrorCode implements ErrorCodeModel { COLOR_CODE_NOT_FOUND_ERR(404, "COLOR_CODE_NOT_FOUND_ERR", "존재하지 않는 색상입니다."), COLOR_ALREADY_PURCHASED_ERR(409, "COLOR_ALREADY_PURCHASED_ERR", "이미 구매한 색상입니다."), + VALIDATION_ERR(400, "VALIDATION_ERR", "잘못된 입력입니다. 올바른 값을 입력해주세요."), PERMISSION_ERR(403, "PERMISSION_ERR", "접근 권한이 없습니다. 관리자에게 문의하세요."), TIMEOUT_ERR(408, "TIMEOUT_ERR", "요청 시간이 초과되었습니다. 다시 시도해주세요."), diff --git a/src/test/java/chzzk/grassdiary/domain/diary/service/BrowseDiaryServiceTest.java b/src/test/java/chzzk/grassdiary/domain/diary/service/BrowseDiaryServiceTest.java index 0913b2cc..4c06b8d8 100644 --- a/src/test/java/chzzk/grassdiary/domain/diary/service/BrowseDiaryServiceTest.java +++ b/src/test/java/chzzk/grassdiary/domain/diary/service/BrowseDiaryServiceTest.java @@ -1,7 +1,7 @@ package chzzk.grassdiary.domain.diary.service; -import chzzk.grassdiary.domain.color.ColorCode; -import chzzk.grassdiary.domain.color.ColorCodeDAO; +import chzzk.grassdiary.domain.color.entity.ColorCode; +import chzzk.grassdiary.domain.color.entity.ColorCodeDAO; import chzzk.grassdiary.domain.color.ConditionLevel; import chzzk.grassdiary.domain.diary.dto.browse.DiaryPreviewDTO; import chzzk.grassdiary.domain.diary.entity.Diary; diff --git a/src/test/java/chzzk/grassdiary/domain/member/service/MemberServiceTest.java b/src/test/java/chzzk/grassdiary/domain/member/service/MemberServiceTest.java index bd9da729..1648979f 100644 --- a/src/test/java/chzzk/grassdiary/domain/member/service/MemberServiceTest.java +++ b/src/test/java/chzzk/grassdiary/domain/member/service/MemberServiceTest.java @@ -1,6 +1,6 @@ package chzzk.grassdiary.domain.member.service; -import chzzk.grassdiary.domain.color.ColorCodeDAO; +import chzzk.grassdiary.domain.color.entity.ColorCodeDAO; import chzzk.grassdiary.domain.member.entity.Member; import chzzk.grassdiary.domain.member.entity.MemberDAO; import chzzk.grassdiary.global.auth.service.dto.GoogleUserInfo;