test #72
| @@ -57,6 +57,7 @@ import java.time.LocalDateTime | ||||
| import java.time.ZoneId | ||||
| import java.time.format.DateTimeFormatter | ||||
| import java.util.Date | ||||
| import java.util.Locale | ||||
| import java.util.concurrent.locks.ReentrantReadWriteLock | ||||
| import kotlin.concurrent.write | ||||
|  | ||||
| @@ -125,14 +126,13 @@ class LiveRoomService( | ||||
|                 val beginDateTime = it.beginDateTime | ||||
|                     .atZone(ZoneId.of("UTC")) | ||||
|                     .withZoneSameInstant(ZoneId.of(timezone)) | ||||
|                     .format(DateTimeFormatter.ofPattern("yyyy년 MM월 dd일 (E) a HH시 mm분").withLocale(Locale.KOREAN)) | ||||
|  | ||||
|                 GetRoomListResponse( | ||||
|                     roomId = it.id!!, | ||||
|                     title = it.title, | ||||
|                     content = it.notice, | ||||
|                     beginDateTime = beginDateTime.format( | ||||
|                         DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a") | ||||
|                     ), | ||||
|                     beginDateTime = beginDateTime, | ||||
|                     numberOfParticipate = (roomInfo?.listenerCount ?: 0) + | ||||
|                         (roomInfo?.speakerCount ?: 0) + | ||||
|                         (roomInfo?.managerCount ?: 0), | ||||
| @@ -297,6 +297,7 @@ class LiveRoomService( | ||||
|         val beginDateTime = room.beginDateTime | ||||
|             .atZone(ZoneId.of("UTC")) | ||||
|             .withZoneSameInstant(ZoneId.of(timezone)) | ||||
|             .format(DateTimeFormatter.ofPattern("yyyy년 MM월 dd일 (E) a HH시 mm분").withLocale(Locale.KOREAN)) | ||||
|  | ||||
|         val response = GetRoomDetailResponse( | ||||
|             roomId = roomId, | ||||
| @@ -307,7 +308,7 @@ class LiveRoomService( | ||||
|             numberOfParticipantsTotal = room.numberOfPeople, | ||||
|             numberOfParticipants = 0, | ||||
|             channelName = room.channelName, | ||||
|             beginDateTime = beginDateTime.format(DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a")), | ||||
|             beginDateTime = beginDateTime, | ||||
|             isPaid = false, | ||||
|             isAdult = room.isAdult, | ||||
|             isPrivateRoom = room.type == LiveRoomType.PRIVATE, | ||||
| @@ -384,27 +385,29 @@ class LiveRoomService( | ||||
|         val room = repository.getLiveRoomAndAccountId(request.roomId, member.id!!) | ||||
|             ?: throw SodaException("해당하는 라이브가 없습니다.") | ||||
|  | ||||
|         val dateTime = LocalDateTime.now() | ||||
|             .atZone(ZoneId.of("UTC")) | ||||
|             .withZoneSameInstant(ZoneId.of(request.timezone)) | ||||
|             .toLocalDateTime() | ||||
|         val nowDateTime = LocalDateTime.now() | ||||
|  | ||||
|         val beginDateTime = room.beginDateTime | ||||
|             .atZone(ZoneId.of("UTC")) | ||||
|             .withZoneSameInstant(ZoneId.of(request.timezone)) | ||||
|             .toLocalDateTime() | ||||
|         if (nowDateTime.plusMinutes(10).isBefore(room.beginDateTime)) { | ||||
|             val startAvailableDateTimeString = room.beginDateTime | ||||
|                 .minusMinutes(10) | ||||
|                 .atZone(ZoneId.of("UTC")) | ||||
|                 .withZoneSameInstant(ZoneId.of("Asia/Seoul")) | ||||
|                 .format(DateTimeFormatter.ofPattern("yyyy년 MM월 dd일 (E) a HH시 mm분").withLocale(Locale.KOREAN)) | ||||
|  | ||||
|         if (dateTime.plusMinutes(10).isBefore(beginDateTime)) { | ||||
|             val startAvailableDateTimeString = beginDateTime.minusMinutes(10).format( | ||||
|                 DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a") | ||||
|             ) | ||||
|             throw SodaException("$startAvailableDateTimeString 이후에 시작할 수 있습니다.") | ||||
|         } | ||||
|  | ||||
|         val dateTime = nowDateTime | ||||
|             .atZone(ZoneId.of("UTC")) | ||||
|             .withZoneSameInstant(ZoneId.of(request.timezone)) | ||||
|             .toLocalDateTime() | ||||
|  | ||||
|         room.channelName = "SODA_LIVE_CHANNEL_" + | ||||
|             "${member.id}_${dateTime.year}_${dateTime.month}_${dateTime.dayOfMonth}_" + | ||||
|             "${dateTime.hour}_${dateTime.minute}" | ||||
|  | ||||
|         room.beginDateTime = nowDateTime | ||||
|  | ||||
|         applicationEventPublisher.publishEvent( | ||||
|             FcmEvent( | ||||
|                 type = FcmEventType.START_LIVE, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user