@@ -87,23 +87,23 @@ public LiveItemCreateResponse writeLiveItem(LiveItemCreateRequest reqBody, User
8787
8888 LocalDateTime now = LocalDateTime .now ();
8989
90- // // 1. 현재 시간과 liveTime 차이 확인
91- // if (reqBody.startAt().isBefore(now.plusHours(1))) {
92- // throw new BusinessException(ErrorCode.CLOSE_LIVETIME);
93- // }
94- //
95- // LocalTime liveTimeOnly = reqBody.startAt().toLocalTime();
96- // // 2. 허용 시간 범위 체크 (09:00 ~ 23:00)
97- // if (liveTimeOnly.isBefore(LocalTime.of(9, 0)) || liveTimeOnly.isAfter(LocalTime.of(23, 0))) {
98- // throw new BusinessException(ErrorCode.INVALID_LIVETIME);
99- // }
100- //
101- // // 3. 30분 단위 체크 + 초 체크
102- // int minute = liveTimeOnly.getMinute();
103- // int second = liveTimeOnly.getSecond();
104- // if ((minute != 0 && minute != 30)|| second !=0) {
105- // throw new BusinessException(ErrorCode.INVALID_LIVETIME);
106- // }
90+ // 1. 현재 시간과 liveTime 차이 확인
91+ if (reqBody .startAt ().isBefore (now .plusHours (1 ))) {
92+ throw new BusinessException (ErrorCode .CLOSE_LIVETIME );
93+ }
94+
95+ LocalTime liveTimeOnly = reqBody .startAt ().toLocalTime ();
96+ // 2. 허용 시간 범위 체크 (09:00 ~ 23:00)
97+ if (liveTimeOnly .isBefore (LocalTime .of (9 , 0 )) || liveTimeOnly .isAfter (LocalTime .of (23 , 0 ))) {
98+ throw new BusinessException (ErrorCode .INVALID_LIVETIME );
99+ }
100+
101+ // 3. 30분 단위 체크 + 초 체크
102+ int minute = liveTimeOnly .getMinute ();
103+ int second = liveTimeOnly .getSecond ();
104+ if ((minute != 0 && minute != 30 )|| second !=0 ) {
105+ throw new BusinessException (ErrorCode .INVALID_LIVETIME );
106+ }
107107
108108 // 4. 이미지 있는지 체크
109109 if (reqBody .images () == null || reqBody .images ().isEmpty ()) {
0 commit comments