-
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/#87 get lottery
- Loading branch information
Showing
13 changed files
with
106 additions
and
75 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
26 changes: 26 additions & 0 deletions
26
...main/java/JGS/CasperEvent/domain/event/dto/ResponseDto/LotteryEventDetailResponseDto.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,26 @@ | ||
package JGS.CasperEvent.domain.event.dto.ResponseDto; | ||
|
||
import JGS.CasperEvent.domain.event.entity.event.LotteryEvent; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
public record LotteryEventDetailResponseDto(LocalDateTime startDateTime, LocalDateTime endDateTime, | ||
AtomicInteger appliedCount, int winnerCount, | ||
LocalDateTime createdAt, LocalDateTime updatedAt) { | ||
public static ArrayList<LotteryEventDetailResponseDto> of(List<LotteryEvent> lotteryEvent) { | ||
ArrayList<LotteryEventDetailResponseDto> lotteryEventDtoList = new ArrayList<>(); | ||
for (LotteryEvent event : lotteryEvent) { | ||
lotteryEventDtoList.add(new LotteryEventDetailResponseDto( | ||
event.getStartDateTime(), | ||
event.getEndDateTime(), | ||
event.getAppliedCount(), | ||
event.getWinnerCount(), | ||
event.getCreatedAt(), | ||
event.getUpdatedAt())); | ||
} | ||
return lotteryEventDtoList; | ||
} | ||
} |
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
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
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
4 changes: 4 additions & 0 deletions
4
Server/src/main/java/JGS/CasperEvent/global/error/exception/LotteryEventNotExists.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,4 @@ | ||
package JGS.CasperEvent.global.error.exception; | ||
|
||
public class LotteryEventNotExists extends RuntimeException{ | ||
} |
5 changes: 5 additions & 0 deletions
5
...er/src/main/java/JGS/CasperEvent/global/error/exception/TooManyLotteryEventException.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,5 @@ | ||
package JGS.CasperEvent.global.error.exception; | ||
|
||
public class TooManyLotteryEventException extends RuntimeException { | ||
|
||
} |
1 change: 0 additions & 1 deletion
1
...a/JGS/CasperEvent/domain/event/controller/eventController/LotteryEventControllerTest.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