-
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.
Merge branch 'dev' into feat/#81-lottery-event
- Loading branch information
Showing
24 changed files
with
398 additions
and
124 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
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
27 changes: 27 additions & 0 deletions
27
.../src/main/java/JGS/CasperEvent/domain/event/dto/ResponseDto/MainRushEventResponseDto.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,27 @@ | ||
package JGS.CasperEvent.domain.event.dto.ResponseDto; | ||
|
||
import JGS.CasperEvent.domain.event.entity.event.RushEvent; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
public class MainRushEventResponseDto { | ||
private Long rushEventId; | ||
private LocalDateTime startDateTime; | ||
private LocalDateTime endDateTime; | ||
|
||
public MainRushEventResponseDto(Long rushEventId, LocalDateTime startDateTime, LocalDateTime endDateTime) { | ||
this.rushEventId = rushEventId; | ||
this.startDateTime = startDateTime; | ||
this.endDateTime = endDateTime; | ||
} | ||
|
||
public static MainRushEventResponseDto of (RushEvent rushEvent) { | ||
return new MainRushEventResponseDto( | ||
rushEvent.getRushEventId(), | ||
rushEvent.getStartDateTime(), | ||
rushEvent.getEndDateTime() | ||
); | ||
} | ||
} |
31 changes: 0 additions & 31 deletions
31
...a/JGS/CasperEvent/domain/event/dto/ResponseDto/RushEventListAndServerTimeResponseDto.java
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
.../src/main/java/JGS/CasperEvent/domain/event/dto/ResponseDto/RushEventListResponseDto.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 lombok.Getter; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
@Getter | ||
public class RushEventListResponseDto { | ||
private List<MainRushEventResponseDto> events; | ||
private LocalDateTime serverTime; | ||
private Long todayEventId; | ||
private LocalDate eventStartDate; | ||
private LocalDate eventEndDate; | ||
private Long activePeriod; | ||
|
||
public RushEventListResponseDto(List<MainRushEventResponseDto> events, LocalDateTime serverTime, Long todayEventId, LocalDate eventStartDate, LocalDate eventEndDate, Long activePeriod) { | ||
this.events = events; | ||
this.serverTime = serverTime; | ||
this.todayEventId = todayEventId; | ||
this.eventStartDate = eventStartDate; | ||
this.eventEndDate = eventEndDate; | ||
this.activePeriod = activePeriod; | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
...rc/main/java/JGS/CasperEvent/domain/event/dto/ResponseDto/RushEventResultResponseDto.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,22 @@ | ||
package JGS.CasperEvent.domain.event.dto.ResponseDto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class RushEventResultResponseDto { | ||
private final long leftOption; | ||
private final long rightOption; | ||
private final long rank; | ||
private final long totalParticipants; | ||
private final long winnerCount; | ||
|
||
public RushEventResultResponseDto(RushEventRateResponseDto rushEventRateResponseDto, long rank, long totalParticipants, long winnerCount) { | ||
this.leftOption = rushEventRateResponseDto.leftOption(); | ||
this.rightOption = rushEventRateResponseDto.rightOption(); | ||
this.rank = rank; | ||
this.totalParticipants = totalParticipants; | ||
this.winnerCount = winnerCount; | ||
} | ||
} |
31 changes: 27 additions & 4 deletions
31
Server/src/main/java/JGS/CasperEvent/domain/event/entity/event/BaseEvent.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,15 +1,38 @@ | ||
package JGS.CasperEvent.domain.event.entity.event; | ||
|
||
import JGS.CasperEvent.global.entity.BaseEntity; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; | ||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; | ||
import jakarta.persistence.MappedSuperclass; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@MappedSuperclass | ||
@Getter | ||
@MappedSuperclass | ||
public class BaseEvent extends BaseEntity { | ||
protected LocalDateTime eventStartDate; | ||
protected LocalDateTime eventEndDate; | ||
protected int winnerCount; | ||
@JsonSerialize(using = LocalDateTimeSerializer.class) | ||
@JsonDeserialize(using = LocalDateTimeDeserializer.class) | ||
private LocalDateTime startDateTime; | ||
|
||
@JsonSerialize(using = LocalDateTimeSerializer.class) | ||
@JsonDeserialize(using = LocalDateTimeDeserializer.class) | ||
private LocalDateTime endDateTime; | ||
private int winnerCount; | ||
|
||
// 기본 생성자에서 디폴트 값 설정 | ||
public BaseEvent() { | ||
this.startDateTime = LocalDateTime.now(); | ||
this.endDateTime = LocalDateTime.now().plusMinutes(10); | ||
this.winnerCount = 0; // 기본 우승자 수를 0으로 설정 | ||
} | ||
|
||
// 특정 값을 설정할 수 있는 생성자 | ||
public BaseEvent(LocalDateTime startDateTime, LocalDateTime endDateTime, int winnerCount) { | ||
this.startDateTime = startDateTime; | ||
this.endDateTime = endDateTime; | ||
this.winnerCount = winnerCount; | ||
} | ||
} |
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
Oops, something went wrong.