88import io .swagger .v3 .oas .annotations .media .Schema ;
99import jakarta .validation .constraints .NotBlank ;
1010import jakarta .validation .constraints .NotNull ;
11- import jakarta .validation .constraints .Positive ;
1211import java .time .LocalDateTime ;
13- import java .time .LocalTime ;
1412import java .util .UUID ;
1513import lombok .Builder ;
1614
@@ -29,24 +27,22 @@ public record RecruitBoardCreateRequestDto(
2927 @ Schema (description = "예상 모집 인원" , example = "4" )
3028 @ NotNull (message = "예상 모집 인원은 필수 값입니다." )
3129 Integer recruitmentCount ,
32- @ Schema (description = "봉사 일시" , example = "2024-11-20T10:00:00" )
33- @ NotNull (message = "봉사 일시는 필수 값입니다." )
34- LocalDateTime volunteerDate ,
30+ @ Schema (description = "봉사 시작 일시" , example = "2024-11-20T10:00:00" )
31+ @ NotNull (message = "봉사 시작 일시는 필수 값입니다." )
32+ LocalDateTime volunteerStartDateTime ,
33+ @ Schema (description = "봉사 종료 일시" , example = "2024-11-20T12:00:00" )
34+ @ NotNull (message = "봉사 종료 일시는 필수 값입니다." )
35+ LocalDateTime volunteerEndDateTime ,
3536 @ Schema (description = "봉사 활동 유형" , example = "ENVIRONMENTAL_PROTECTION" )
3637 @ NotNull (message = "봉사 활동 유형은 필수 값입니다." )
3738 VolunteerType volunteerType ,
38- @ Schema (description = "봉사 시간(시)" , example = "1" )
39- @ Positive (message = "봉사 시간(시)은 1이상 이어야 합니다." )
40- Integer volunteerHours ,
41- @ Schema (description = "봉사 시간(분)" , example = "30" )
42- @ Positive (message = "봉사 시간(분)은 1이상 이어야 합니다." )
43- Integer volunteerMinutes ,
4439 @ Schema (description = "봉사 시간 인정 여부" , example = "true" )
4540 @ NotNull (message = "시간 인정 여부는 필수 값입니다." )
4641 Boolean admitted ,
4742 @ NotNull (message = "위치 정보는 필수 값입니다." )
4843 LocationCreateRequestDto location
49- ){
44+ ) {
45+
5046 public RecruitBoard toEntity (UUID centerId , Long locationId , String imgUrl ) {
5147 return RecruitBoard .builder ()
5248 .centerId (centerId )
@@ -56,9 +52,9 @@ public RecruitBoard toEntity(UUID centerId, Long locationId, String imgUrl) {
5652 .region (region )
5753 .recruitmentCount (recruitmentCount )
5854 .imgUrl (imgUrl )
59- .volunteerDate (volunteerDate )
55+ .volunteerStartDateTime (volunteerStartDateTime )
56+ .volunteerEndDateTime (volunteerEndDateTime )
6057 .volunteerType (volunteerType )
61- .volunteerHours (LocalTime .of (volunteerHours , volunteerMinutes ))
6258 .admitted (admitted )
6359 .build ();
6460 }
0 commit comments