Skip to content

Commit

Permalink
Merge pull request #102 from softeerbootcamp4th/fix/casperFix
Browse files Browse the repository at this point in the history
Fix/casper fix
  • Loading branch information
k000927 authored Aug 12, 2024
2 parents 6930699 + 80ecceb commit 81cac21
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package JGS.CasperEvent.domain.event.dto.RequestDto.rushEventDto;

import lombok.Getter;
import lombok.ToString;

@ToString
@Getter
public class RushEventOptionRequestDto {
private String mainText;
private String subText;
private String resultMainText;
private String resultSubText;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package JGS.CasperEvent.domain.event.dto.RequestDto.rushEventDto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.ToString;

import java.time.LocalDate;
import java.time.LocalTime;

@ToString
@Getter
public class RushEventRequestDto {
private LocalDate eventDate;
private LocalTime startTime;
private LocalTime endTime;
private int winnerCount;
private String prizeDescription;
@JsonProperty("leftOption")
private RushEventOptionRequestDto leftOption;
@JsonProperty("rightOption")
private RushEventOptionRequestDto rightOption;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

public record LotteryEventDetailResponseDto(
LocalDate startDate, LocalTime startTime,
LocalDate endDate, LocalTime endTime,
AtomicInteger appliedCount, int winnerCount,
int appliedCount, int winnerCount,
LocalDateTime createdAt, LocalDateTime updatedAt) {

public static ArrayList<LotteryEventDetailResponseDto> of(List<LotteryEvent> lotteryEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import lombok.Getter;

import java.time.LocalDateTime;
import java.util.concurrent.atomic.AtomicInteger;

@Getter
@MappedSuperclass
Expand All @@ -22,25 +21,25 @@ public class BaseEvent extends BaseEntity {
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
protected LocalDateTime endDateTime;
protected int winnerCount;
protected AtomicInteger totalAppliedCount;
protected int totalAppliedCount;

// 기본 생성자에서 디폴트 값 설정
public BaseEvent() {
this.startDateTime = LocalDateTime.now();
this.endDateTime = LocalDateTime.now().plusMinutes(10);
this.winnerCount = 0; // 기본 우승자 수를 0으로 설정
this.totalAppliedCount = new AtomicInteger(0);
this.totalAppliedCount = 0;
}

// 특정 값을 설정할 수 있는 생성자
public BaseEvent(LocalDateTime startDateTime, LocalDateTime endDateTime, int winnerCount) {
this.startDateTime = startDateTime;
this.endDateTime = endDateTime;
this.winnerCount = winnerCount;
this.totalAppliedCount = new AtomicInteger(0);
this.totalAppliedCount = 0;
}

public void addAppliedCount(){
this.totalAppliedCount.addAndGet(1);
public void addAppliedCount() {
this.totalAppliedCount++;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@
@Configuration
public class WebConfig implements WebMvcConfigurer {

// @Override
// public void addCorsMappings(CorsRegistry registration) {
// registration.addMapping("/**")
// .allowCredentials(true)
// .allowedOrigins("http://localhost:5173", "https://d3phfzvzx3wm4l.cloudfront.net/")
// .allowedMethods("GET", "POST", "PUT", "DELETE")
// .allowedHeaders("*");
// }

@Bean
public FilterRegistrationBean<CorsFilter> corsFilterRegistrationBean() {
FilterRegistrationBean<CorsFilter> registrationBean = new FilterRegistrationBean<>();
Expand Down

0 comments on commit 81cac21

Please sign in to comment.