-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
80 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/main/java/com/nice/petudio/api/controller/member/service/PointServiceUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/com/nice/petudio/domain/member/point/TicketType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.nice.petudio.domain.member.point; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public enum TicketType { | ||
DEFAULT(8_800); | ||
|
||
private final int price; | ||
} |
7 changes: 0 additions & 7 deletions
7
src/main/java/com/nice/petudio/domain/member/point/repository/PointRepository.java
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
src/main/java/com/nice/petudio/domain/member/point/repository/PointRepositoryCustom.java
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
src/main/java/com/nice/petudio/domain/member/point/repository/TicketRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.nice.petudio.domain.member.point.repository; | ||
|
||
import com.nice.petudio.domain.member.point.Ticket; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface TicketRepository extends TicketRepositoryCustom, JpaRepository<Ticket, Long> { | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/nice/petudio/domain/member/point/repository/TicketRepositoryCustom.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.nice.petudio.domain.member.point.repository; | ||
|
||
import com.nice.petudio.domain.member.point.Ticket; | ||
import java.util.Optional; | ||
|
||
public interface TicketRepositoryCustom { | ||
Optional<Ticket> findByMemberId(Long memberId); | ||
} |
13 changes: 7 additions & 6 deletions
13
...point/repository/PointRepositoryImpl.java → ...oint/repository/TicketRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
package com.nice.petudio.domain.member.point.repository; | ||
|
||
import static com.nice.petudio.domain.member.point.QPoint.point; | ||
|
||
import com.nice.petudio.domain.member.point.Point; | ||
import static com.nice.petudio.domain.member.point.QTicket.ticket; | ||
|
||
import com.nice.petudio.domain.member.point.Ticket; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import java.util.Optional; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public class PointRepositoryImpl implements PointRepositoryCustom { | ||
public class TicketRepositoryImpl implements TicketRepositoryCustom { | ||
private final JPAQueryFactory queryFactory; | ||
|
||
@Override | ||
public Optional<Point> findByMemberId(Long memberId) { | ||
public Optional<Ticket> findByMemberId(Long memberId) { | ||
return Optional.ofNullable(queryFactory | ||
.selectFrom(point) | ||
.where(point.memberId.eq(memberId)) | ||
.selectFrom(ticket) | ||
.where(ticket.memberId.eq(memberId)) | ||
.fetchOne()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters