Skip to content

Commit

Permalink
feat: 회원 정보로 쿠폰 조회 기능 추가
Browse files Browse the repository at this point in the history
jwt 토큰에 있는 정보를 활용하여 회원 정보로 쿠폰 조회를 진행하는 기능을 구현했습니다.
  • Loading branch information
akfrdma0125 committed Aug 5, 2023
1 parent 01142d6 commit 526e3f3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ private List<PostNearbyStoreResponse> getCandidateStoreList(PostNearbyStoreReque
public GetBrandResponse getGetBrandResponse(Principal principal, Long id) {

// 멤버 ID
// Long memberId = findMemberIdByPrincipal(principal);
Long memberId = findMemberIdByPrincipal(principal);

Brand brand = brandRepository.findById(id).get();

if (brand == null) throw new BrandException(BRAND_NOT_FOUND);

CouponItem couponItem = couponItemRepository.findByMemberIdAndBrandIdAndStatus(id, id, CouponItemStatus.ACTIVE);
CouponItem couponItem = couponItemRepository.findByMemberIdAndBrandIdAndStatus(memberId, id, CouponItemStatus.ACTIVE);

if (couponItem == null) // 해당 브랜드에 쿠폰이 없을 경우
return new GetBrandResponse(brand, 0);
Expand Down

0 comments on commit 526e3f3

Please sign in to comment.