diff --git a/DuDoong-Api/src/main/java/band/gosrock/api/event/model/dto/request/CreateEventRequest.java b/DuDoong-Api/src/main/java/band/gosrock/api/event/model/dto/request/CreateEventRequest.java index e680dcbb..fd6bdbcc 100644 --- a/DuDoong-Api/src/main/java/band/gosrock/api/event/model/dto/request/CreateEventRequest.java +++ b/DuDoong-Api/src/main/java/band/gosrock/api/event/model/dto/request/CreateEventRequest.java @@ -4,6 +4,7 @@ import band.gosrock.common.annotation.DateFormat; import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDateTime; +import javax.validation.constraints.Future; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Positive; @@ -19,7 +20,7 @@ public class CreateEventRequest { private Long hostId; @Schema(defaultValue = "고스락 제 22회 정기공연", description = "공연 이름") - @NotBlank(message = "공연 이름을 입력하세요") + @NotBlank(message = "공연 이름을 입력하세요.") @Length(max = 25) private String name; @@ -28,11 +29,12 @@ public class CreateEventRequest { pattern = "yyyy.MM.dd HH:mm", defaultValue = "2023.03.20 12:00", description = "공연 시작 시각") - @NotNull(message = "공연 시작 시각을 입력하세요") + @NotNull(message = "공연 시작 시각을 입력하세요.") + @Future(message = "공연 시작 시각은 현재보다 이후여야 합니다.") @DateFormat private LocalDateTime startAt; @Schema(defaultValue = "90", description = "공연 진행시간") - @Positive(message = "공연 진행 예상 소요시간(분)을 입력하세요") + @Positive(message = "공연 진행 예상 소요시간(분)을 입력하세요.") private Long runTime; } diff --git a/DuDoong-Api/src/main/java/band/gosrock/api/event/model/dto/request/UpdateEventBasicRequest.java b/DuDoong-Api/src/main/java/band/gosrock/api/event/model/dto/request/UpdateEventBasicRequest.java index 0bffbd1e..4a934693 100644 --- a/DuDoong-Api/src/main/java/band/gosrock/api/event/model/dto/request/UpdateEventBasicRequest.java +++ b/DuDoong-Api/src/main/java/band/gosrock/api/event/model/dto/request/UpdateEventBasicRequest.java @@ -4,6 +4,7 @@ import band.gosrock.common.annotation.DateFormat; import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDateTime; +import javax.validation.constraints.Future; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Positive; @@ -25,6 +26,7 @@ public class UpdateEventBasicRequest { defaultValue = "2023.03.20 12:00", description = "공연 시작 시각") @NotNull(message = "공연 시작 시각을 입력하세요") + @Future(message = "공연 시작 시각은 현재보다 이후여야 합니다.") @DateFormat private LocalDateTime startAt; diff --git a/DuDoong-Api/src/main/java/band/gosrock/api/event/model/mapper/EventMapper.java b/DuDoong-Api/src/main/java/band/gosrock/api/event/model/mapper/EventMapper.java index 5208c419..c7eca8b8 100644 --- a/DuDoong-Api/src/main/java/band/gosrock/api/event/model/mapper/EventMapper.java +++ b/DuDoong-Api/src/main/java/band/gosrock/api/event/model/mapper/EventMapper.java @@ -19,7 +19,6 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; -import org.springframework.transaction.annotation.Transactional; @Mapper @RequiredArgsConstructor @@ -29,7 +28,6 @@ public class EventMapper { private final EventAdaptor eventAdaptor; private final TicketItemAdaptor ticketItemAdaptor; - @Transactional(readOnly = true) public Event toEntity(CreateEventRequest createEventRequest) { return Event.builder() .hostId(createEventRequest.getHostId())