From e79cad804a93bd75402cc66ee3ce5655cd9b3464 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:56:51 +0900 Subject: [PATCH 01/14] =?UTF-8?q?[chore]=20QueryDsl=20=EC=9D=98=EC=A1=B4?= =?UTF-8?q?=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.gradle b/build.gradle index 382798f8..052f236d 100644 --- a/build.gradle +++ b/build.gradle @@ -42,11 +42,18 @@ dependencies { runtimeOnly "io.jsonwebtoken:jjwt-jackson:${JJWT_VERSION}" runtimeOnly "io.jsonwebtoken:jjwt-impl:${JJWT_VERSION}" + // queryDsl + implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' + annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" + annotationProcessor "jakarta.annotation:jakarta.annotation-api" + annotationProcessor "jakarta.persistence:jakarta.persistence-api" + testImplementation "org.junit.jupiter:junit-jupiter:5.8.1" testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test' } + tasks.named('bootBuildImage') { builder = 'paketobuildpacks/builder-jammy-base:latest' } From a0a0ad4896d5b8070a247892c9d268e8b4aee352 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:57:26 +0900 Subject: [PATCH 02/14] =?UTF-8?q?[feat]=20=ED=86=B5=ED=95=A9=20=EC=BF=A0?= =?UTF-8?q?=ED=8F=B0=20=EC=83=81=ED=83=9C=20=EC=B6=94=EA=B0=80,=20?= =?UTF-8?q?=EC=88=99=EC=86=8C=EC=99=80=EC=9D=98=20=EC=9D=98=EC=A1=B4?= =?UTF-8?q?=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/coolpeace/domain/coupon/entity/Coupon.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/coolpeace/domain/coupon/entity/Coupon.java b/src/main/java/com/coolpeace/domain/coupon/entity/Coupon.java index a646dd06..1c1566da 100644 --- a/src/main/java/com/coolpeace/domain/coupon/entity/Coupon.java +++ b/src/main/java/com/coolpeace/domain/coupon/entity/Coupon.java @@ -1,5 +1,6 @@ package com.coolpeace.domain.coupon.entity; +import com.coolpeace.domain.accommodation.entity.Accommodation; import com.coolpeace.domain.member.entity.Member; import com.coolpeace.domain.room.entity.Room; import com.coolpeace.global.common.BaseTimeEntity; @@ -25,6 +26,8 @@ public class Coupon extends BaseTimeEntity { private String title; + private CouponStatus couponStatus; + private DiscountType discountType; private int maxDiscount; @@ -45,9 +48,9 @@ public class Coupon extends BaseTimeEntity { private LocalDateTime expiration; - private Boolean isExposure; - - private Boolean isDeleted; + @ManyToOne + @JoinColumn(name = "accommodation_id") + private Accommodation accommodation; @ManyToOne @JoinColumn(name = "room_id") From fb252a327437f604115b6b088a0a1bca3b382e13 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:59:23 +0900 Subject: [PATCH 03/14] =?UTF-8?q?[feat]=20=EC=9D=BC=EA=B0=84=20=EB=A6=AC?= =?UTF-8?q?=ED=8F=AC=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EB=8A=94=20Coupon=20Request=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/coupon/dto/request/CouponDailyRequest.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/main/java/com/coolpeace/domain/coupon/dto/request/CouponDailyRequest.java diff --git a/src/main/java/com/coolpeace/domain/coupon/dto/request/CouponDailyRequest.java b/src/main/java/com/coolpeace/domain/coupon/dto/request/CouponDailyRequest.java new file mode 100644 index 00000000..419ecaf3 --- /dev/null +++ b/src/main/java/com/coolpeace/domain/coupon/dto/request/CouponDailyRequest.java @@ -0,0 +1,9 @@ +package com.coolpeace.domain.coupon.dto.request; + + +public record CouponDailyRequest( + Long memberId, + Long accommodationId +) { + +} From da45a1a2964f083ed1aea2c73f5f1aed72eb1528 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:00:50 +0900 Subject: [PATCH 04/14] =?UTF-8?q?[feat]=20=EC=9D=BC=EA=B0=84=20=EB=A6=AC?= =?UTF-8?q?=ED=8F=AC=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EB=8A=94=20Coupon=20Response=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coupon/dto/response/CouponDailyResponse.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/main/java/com/coolpeace/domain/coupon/dto/response/CouponDailyResponse.java diff --git a/src/main/java/com/coolpeace/domain/coupon/dto/response/CouponDailyResponse.java b/src/main/java/com/coolpeace/domain/coupon/dto/response/CouponDailyResponse.java new file mode 100644 index 00000000..73b0713b --- /dev/null +++ b/src/main/java/com/coolpeace/domain/coupon/dto/response/CouponDailyResponse.java @@ -0,0 +1,11 @@ +package com.coolpeace.domain.coupon.dto.response; + +import java.util.List; +import lombok.Builder; + +@Builder +public record CouponDailyResponse( + String condition, + List couponTitle +) { +} From 72226c65dc6e7e3e2a796822d825f47fa9f8059d Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:04:58 +0900 Subject: [PATCH 05/14] =?UTF-8?q?[feat]=20queryDsl=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9D=84=20=EC=9C=84=ED=95=9C=20Repository=20Custom=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/CouponRepositoryCustom.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryCustom.java diff --git a/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryCustom.java b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryCustom.java new file mode 100644 index 00000000..64196a95 --- /dev/null +++ b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryCustom.java @@ -0,0 +1,18 @@ +package com.coolpeace.domain.coupon.repository; + + +import com.coolpeace.domain.coupon.entity.Coupon; +import java.util.List; + +public interface CouponRepositoryCustom { + + List exposureCoupons(Long memberId, Long accommodationId); + + Boolean NoRegister(Long memberId,Long accommodationId); + + Boolean NoExposure(Long memberId,Long accommodationId); + + List expiration3days(Long memberId,Long accommodationId); + + +} From b2fca0f1a2f14731089f4d6240b9498ad5df90b5 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:52:37 +0900 Subject: [PATCH 06/14] =?UTF-8?q?[feat]=20=EC=9D=BC=EA=B0=84=20=EB=A6=AC?= =?UTF-8?q?=ED=8F=AC=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=93=B0=EC=9D=BC=20?= =?UTF-8?q?=EC=BF=BC=EB=A6=AC=EB=AC=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/CouponRepositoryImpl.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java diff --git a/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java new file mode 100644 index 00000000..fc7adefe --- /dev/null +++ b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java @@ -0,0 +1,62 @@ +package com.coolpeace.domain.coupon.repository; + +import static com.coolpeace.domain.coupon.entity.QCoupon.coupon; + +import com.coolpeace.domain.accommodation.entity.Accommodation; +import com.coolpeace.domain.coupon.entity.Coupon; +import com.coolpeace.domain.coupon.entity.CouponStatus; +import com.coolpeace.domain.member.entity.Member; +import com.querydsl.jpa.impl.JPAQueryFactory; +import jakarta.persistence.EntityManager; +import java.time.LocalDateTime; +import java.util.List; + +public class CouponRepositoryImpl implements CouponRepositoryCustom{ + + private final JPAQueryFactory jpaQueryFactory; + + public CouponRepositoryImpl(EntityManager entityManager) { + this.jpaQueryFactory = new JPAQueryFactory(entityManager); + } + + + @Override + public List exposureCoupons(Long memberId, Long accommodationId) { + return jpaQueryFactory.selectFrom(coupon) + .where(coupon.member.id.eq(memberId) + .and(coupon.accommodation.id.eq(accommodationId)) + .and(coupon.couponStatus.eq(CouponStatus.EXPOSURE_ON))) + .fetch(); + } + + @Override + public Boolean NoRegister(Long memberId, Long accommodationId) { + + return jpaQueryFactory.selectFrom(coupon) + .where(coupon.member.id.eq(memberId) + .and(coupon.accommodation.id.eq(accommodationId)) + .and(coupon.couponStatus.ne(CouponStatus.DELETED))) + .fetch().isEmpty(); + } + + @Override + public Boolean NoExposure(Long memberId, Long accommodationId) { + + return jpaQueryFactory.selectFrom(coupon) + .where(coupon.member.id.eq(memberId) + .and(coupon.accommodation.id.eq(accommodationId)) + .and(coupon.couponStatus.eq(CouponStatus.EXPOSURE_ON))) + .fetch().isEmpty(); + } + + + @Override + public List expiration3days(Long memberId, Long accommodationId) { + return jpaQueryFactory.selectFrom(coupon) + .where(coupon.member.id.eq(memberId) + .and(coupon.accommodation.id.eq(accommodationId)) + .and(coupon.couponStatus.eq(CouponStatus.EXPOSURE_ON)) + .and(coupon.endDate.before(LocalDateTime.now().plusDays(3)))) + .fetch(); + } +} From ad34d0907acba0480804f6a3345e742588d1a8c0 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:53:03 +0900 Subject: [PATCH 07/14] =?UTF-8?q?[feat]=20CouponStatus=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/coupon/entity/CouponStatus.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/main/java/com/coolpeace/domain/coupon/entity/CouponStatus.java diff --git a/src/main/java/com/coolpeace/domain/coupon/entity/CouponStatus.java b/src/main/java/com/coolpeace/domain/coupon/entity/CouponStatus.java new file mode 100644 index 00000000..2726ce78 --- /dev/null +++ b/src/main/java/com/coolpeace/domain/coupon/entity/CouponStatus.java @@ -0,0 +1,15 @@ +package com.coolpeace.domain.coupon.entity; + +public enum CouponStatus { + EXPOSURE_ON("노출 ON"), + EXPOSURE_OFF("노출 OFF"), + EXPOSURE_WAIT("노출 대기중"), + EXPOSURE_END("노출 종료"), + DELETED("논리 삭제"); + + private final String value; + + CouponStatus(String value) { + this.value = value; + } +} From 6b54c81221f0bbf34f0fc0231fbd90f0abe11c1c Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:53:24 +0900 Subject: [PATCH 08/14] =?UTF-8?q?[feat]=20=EC=9D=BC=EA=B0=84=20=EB=A6=AC?= =?UTF-8?q?=ED=8F=AC=ED=8A=B8=20=EB=A9=94=EC=86=8C=EB=93=9C=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coupon/service/CouponQueryService.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/main/java/com/coolpeace/domain/coupon/service/CouponQueryService.java diff --git a/src/main/java/com/coolpeace/domain/coupon/service/CouponQueryService.java b/src/main/java/com/coolpeace/domain/coupon/service/CouponQueryService.java new file mode 100644 index 00000000..1682c2dc --- /dev/null +++ b/src/main/java/com/coolpeace/domain/coupon/service/CouponQueryService.java @@ -0,0 +1,41 @@ +package com.coolpeace.domain.coupon.service; + +import com.coolpeace.domain.coupon.dto.request.CouponDailyRequest; +import com.coolpeace.domain.coupon.dto.response.CouponDailyResponse; +import com.coolpeace.domain.coupon.entity.Coupon; +import com.coolpeace.domain.coupon.repository.CouponRepository; +import java.util.List; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@Transactional(readOnly = true) +@RequiredArgsConstructor +public class CouponQueryService { + + private final CouponRepository couponRepository; + + /* 메소드 복잡도를 낮추는 방법 고안 중 */ + public CouponDailyResponse dailyReport(CouponDailyRequest request) { + if (couponRepository.NoRegister(request.memberId(), request.accommodationId())) { + return CouponDailyResponse.builder().condition("등록된 쿠폰이 없음").build(); + } + if (couponRepository.NoExposure(request.memberId(), request.accommodationId())) { + return CouponDailyResponse.builder().condition("노출 중인 쿠폰이 없음").build(); + } + + List expiration3daysCoupons = couponRepository.expiration3days(request.memberId(), + request.accommodationId()); + if (!expiration3daysCoupons.isEmpty()) { + return CouponDailyResponse.builder().condition("곧 만료되는 쿠폰이 있음") + .couponTitle(expiration3daysCoupons.stream().map(Coupon::getTitle).toList()) + .build(); + } + List exposureCoupons = couponRepository.exposureCoupons(request.memberId(), + request.accommodationId()); + return CouponDailyResponse.builder().condition("아무 조건에 해당하지 않음") + .couponTitle(exposureCoupons.stream().map(Coupon::getTitle).toList()) + .build(); + } +} From 3ae0ffa31e703bdbc6bd37dcb5d3d5e3d2aa7789 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:53:36 +0900 Subject: [PATCH 09/14] =?UTF-8?q?[feat]=20=EC=BF=A0=ED=8F=B0=20=EB=A0=88?= =?UTF-8?q?=ED=8F=AC=EC=A7=80=ED=86=A0=EB=A6=AC=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/coupon/repository/CouponRepository.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/main/java/com/coolpeace/domain/coupon/repository/CouponRepository.java diff --git a/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepository.java b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepository.java new file mode 100644 index 00000000..c3863545 --- /dev/null +++ b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepository.java @@ -0,0 +1,12 @@ +package com.coolpeace.domain.coupon.repository; + +import com.coolpeace.domain.accommodation.entity.Accommodation; +import com.coolpeace.domain.coupon.entity.Coupon; +import com.coolpeace.domain.member.entity.Member; +import java.util.List; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface CouponRepository extends JpaRepository,CouponRepositoryCustom { + + List findAllByMemberAndAccommodation(Member member, Accommodation accommodation); +} From aa8bec9a61ceecd0ea88b189089b988606477810 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:12:09 +0900 Subject: [PATCH 10/14] =?UTF-8?q?[refactor]=20=EB=B9=8C=EB=8D=94=20?= =?UTF-8?q?=ED=8C=A8=ED=84=B4=20->=20=EB=A9=94=EC=86=8C=EB=93=9C=20?= =?UTF-8?q?=EB=B0=A9=EC=8B=9D=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coupon/dto/response/CouponDailyResponse.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/coolpeace/domain/coupon/dto/response/CouponDailyResponse.java b/src/main/java/com/coolpeace/domain/coupon/dto/response/CouponDailyResponse.java index 73b0713b..9f9f2772 100644 --- a/src/main/java/com/coolpeace/domain/coupon/dto/response/CouponDailyResponse.java +++ b/src/main/java/com/coolpeace/domain/coupon/dto/response/CouponDailyResponse.java @@ -1,11 +1,19 @@ package com.coolpeace.domain.coupon.dto.response; +import com.coolpeace.domain.coupon.entity.CouponDailyCondition; +import java.util.Collections; import java.util.List; import lombok.Builder; @Builder public record CouponDailyResponse( - String condition, - List couponTitle + CouponDailyCondition condition, + List couponTitles ) { + public static CouponDailyResponse from(CouponDailyCondition condition,List couponTitles) { + return new CouponDailyResponse(condition, couponTitles); + } + public static CouponDailyResponse from(CouponDailyCondition condition) { + return new CouponDailyResponse(condition, Collections.emptyList()); + } } From 53e30939afd6cdbd37370a39c28dc85d875f0809 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:12:45 +0900 Subject: [PATCH 11/14] =?UTF-8?q?[refactor]=20=EB=8F=99=EC=9D=BC=ED=95=9C?= =?UTF-8?q?=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EC=99=B8=20=EB=B0=8F=20?= =?UTF-8?q?=EB=A9=94=EC=86=8C=EB=93=9C=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coupon/service/CouponQueryService.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/coolpeace/domain/coupon/service/CouponQueryService.java b/src/main/java/com/coolpeace/domain/coupon/service/CouponQueryService.java index 1682c2dc..420859d7 100644 --- a/src/main/java/com/coolpeace/domain/coupon/service/CouponQueryService.java +++ b/src/main/java/com/coolpeace/domain/coupon/service/CouponQueryService.java @@ -3,6 +3,7 @@ import com.coolpeace.domain.coupon.dto.request.CouponDailyRequest; import com.coolpeace.domain.coupon.dto.response.CouponDailyResponse; import com.coolpeace.domain.coupon.entity.Coupon; +import com.coolpeace.domain.coupon.entity.CouponDailyCondition; import com.coolpeace.domain.coupon.repository.CouponRepository; import java.util.List; import lombok.RequiredArgsConstructor; @@ -18,24 +19,24 @@ public class CouponQueryService { /* 메소드 복잡도를 낮추는 방법 고안 중 */ public CouponDailyResponse dailyReport(CouponDailyRequest request) { - if (couponRepository.NoRegister(request.memberId(), request.accommodationId())) { - return CouponDailyResponse.builder().condition("등록된 쿠폰이 없음").build(); + Long memberId = request.memberId(); + Long accommodationId = request.accommodationId(); + + if (couponRepository.noRegister(memberId, accommodationId)) { + return CouponDailyResponse.from(CouponDailyCondition.NO_REGISTER); } - if (couponRepository.NoExposure(request.memberId(), request.accommodationId())) { - return CouponDailyResponse.builder().condition("노출 중인 쿠폰이 없음").build(); + if (couponRepository.noExposure(memberId, accommodationId)) { + return CouponDailyResponse.from(CouponDailyCondition.NO_EXPOSURE); } - List expiration3daysCoupons = couponRepository.expiration3days(request.memberId(), - request.accommodationId()); + List expiration3daysCoupons = couponRepository.expiration3days(memberId, accommodationId); if (!expiration3daysCoupons.isEmpty()) { - return CouponDailyResponse.builder().condition("곧 만료되는 쿠폰이 있음") - .couponTitle(expiration3daysCoupons.stream().map(Coupon::getTitle).toList()) - .build(); + return CouponDailyResponse.from(CouponDailyCondition.EXPIRATION_3DAYS, + expiration3daysCoupons.stream().map(Coupon::getTitle).toList()); } - List exposureCoupons = couponRepository.exposureCoupons(request.memberId(), - request.accommodationId()); - return CouponDailyResponse.builder().condition("아무 조건에 해당하지 않음") - .couponTitle(exposureCoupons.stream().map(Coupon::getTitle).toList()) - .build(); + + List exposureCoupons = couponRepository.exposureCoupons(memberId, accommodationId); + return CouponDailyResponse.from(CouponDailyCondition.NO_CONDITION, + exposureCoupons.stream().map(Coupon::getTitle).toList()); } } From 85c919130ffc08ad40220e463641397a0b5448c3 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:13:03 +0900 Subject: [PATCH 12/14] =?UTF-8?q?[refactor]=20=EB=A9=94=EC=86=8C=EB=93=9C?= =?UTF-8?q?=20=EC=9D=B4=EB=A6=84=20=EC=B9=B4=EB=A9=9C=20=EB=B0=A9=EC=8B=9D?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/coupon/repository/CouponRepositoryCustom.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryCustom.java b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryCustom.java index 64196a95..babe29e1 100644 --- a/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryCustom.java +++ b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryCustom.java @@ -8,9 +8,9 @@ public interface CouponRepositoryCustom { List exposureCoupons(Long memberId, Long accommodationId); - Boolean NoRegister(Long memberId,Long accommodationId); + Boolean noRegister(Long memberId,Long accommodationId); - Boolean NoExposure(Long memberId,Long accommodationId); + Boolean noExposure(Long memberId,Long accommodationId); List expiration3days(Long memberId,Long accommodationId); From b1353316adc72423a25e92f4b8240db2d856ca16 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:13:11 +0900 Subject: [PATCH 13/14] =?UTF-8?q?[refactor]=20=EB=A9=94=EC=86=8C=EB=93=9C?= =?UTF-8?q?=20=EC=9D=B4=EB=A6=84=20=EC=B9=B4=EB=A9=9C=20=EB=B0=A9=EC=8B=9D?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/coupon/repository/CouponRepositoryImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java index fc7adefe..3a705c19 100644 --- a/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java +++ b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java @@ -30,7 +30,7 @@ public List exposureCoupons(Long memberId, Long accommodationId) { } @Override - public Boolean NoRegister(Long memberId, Long accommodationId) { + public Boolean noRegister(Long memberId, Long accommodationId) { return jpaQueryFactory.selectFrom(coupon) .where(coupon.member.id.eq(memberId) @@ -40,7 +40,7 @@ public Boolean NoRegister(Long memberId, Long accommodationId) { } @Override - public Boolean NoExposure(Long memberId, Long accommodationId) { + public Boolean noExposure(Long memberId, Long accommodationId) { return jpaQueryFactory.selectFrom(coupon) .where(coupon.member.id.eq(memberId) From e026ec288b22ab677fb2ad5cf8731466c759c8f3 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:13:37 +0900 Subject: [PATCH 14/14] =?UTF-8?q?[refactor]=20=EC=9D=BC=EA=B0=84=20?= =?UTF-8?q?=EB=A6=AC=ED=8F=AC=ED=8A=B8=20=EC=A1=B0=EA=B1=B4=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20enum=EC=9C=BC=EB=A1=9C=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/coupon/entity/CouponDailyCondition.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/main/java/com/coolpeace/domain/coupon/entity/CouponDailyCondition.java diff --git a/src/main/java/com/coolpeace/domain/coupon/entity/CouponDailyCondition.java b/src/main/java/com/coolpeace/domain/coupon/entity/CouponDailyCondition.java new file mode 100644 index 00000000..de2d392c --- /dev/null +++ b/src/main/java/com/coolpeace/domain/coupon/entity/CouponDailyCondition.java @@ -0,0 +1,14 @@ +package com.coolpeace.domain.coupon.entity; + +public enum CouponDailyCondition { + NO_REGISTER("등록된 쿠폰이 없음"), + NO_EXPOSURE("노출중인 쿠폰이 없음"), + EXPIRATION_3DAYS("곧 만료되는 쿠폰이 있음"), + NO_CONDITION("아무 조건에 해당하지 않음"); + + private final String value; + + CouponDailyCondition(String value) { + this.value = value; + } +}