-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat/#138-get-winners
- Loading branch information
Showing
7 changed files
with
82 additions
and
10 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
7 changes: 7 additions & 0 deletions
7
.../domain/event/dto/ResponseDto/rushEventResponseDto/LotteryEventWinnerListResponseDto.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 JGS.CasperEvent.domain.event.dto.ResponseDto.rushEventResponseDto; | ||
|
||
import java.util.List; | ||
|
||
public record LotteryEventWinnerListResponseDto(List<LotteryEventWinnerResponseDto> participantsList, | ||
Boolean isLastPage, long totalParticipants) { | ||
} |
25 changes: 25 additions & 0 deletions
25
...vent/domain/event/dto/ResponseDto/rushEventResponseDto/LotteryEventWinnerResponseDto.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,25 @@ | ||
package JGS.CasperEvent.domain.event.dto.ResponseDto.rushEventResponseDto; | ||
|
||
import JGS.CasperEvent.domain.event.entity.participants.LotteryWinners; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalTime; | ||
|
||
public record LotteryEventWinnerResponseDto( | ||
Long id, String phoneNumber, int linkClickedCounts, | ||
int expectation, int appliedCount, long ranking, | ||
LocalDate createdDate, LocalTime createdTime) { | ||
|
||
public static LotteryEventWinnerResponseDto of(LotteryWinners lotteryWinner) { | ||
return new LotteryEventWinnerResponseDto( | ||
lotteryWinner.getId(), | ||
lotteryWinner.getPhoneNumber(), | ||
lotteryWinner.getLinkClickedCount(), | ||
lotteryWinner.getExpectation(), | ||
lotteryWinner.getAppliedCount(), | ||
lotteryWinner.getRanking(), | ||
lotteryWinner.getCreatedAt().toLocalDate(), | ||
lotteryWinner.getCreatedAt().toLocalTime() | ||
); | ||
} | ||
} |
10 changes: 9 additions & 1 deletion
10
Server/src/main/java/JGS/CasperEvent/domain/event/entity/participants/LotteryWinners.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
3 changes: 3 additions & 0 deletions
3
...S/CasperEvent/domain/event/repository/participantsRepository/LotteryWinnerRepository.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,9 +1,12 @@ | ||
package JGS.CasperEvent.domain.event.repository.participantsRepository; | ||
|
||
import JGS.CasperEvent.domain.event.entity.participants.LotteryWinners; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface LotteryWinnerRepository extends JpaRepository<LotteryWinners, Long> { | ||
Page<LotteryWinners> findByPhoneNumber(String phoneNumber, Pageable pageable); | ||
} |
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