Compare commits
No commits in common. "20289cad108aab64d7b22c152f4118d46d5487b7" and "e0d64c31c7cc2bccb4bc9b7a82a0091c208d568d" have entirely different histories.
20289cad10
...
e0d64c31c7
|
@ -5,7 +5,6 @@ import kr.co.vividnext.sodalive.content.AudioContentRepository
|
||||||
import kr.co.vividnext.sodalive.fcm.FcmEvent
|
import kr.co.vividnext.sodalive.fcm.FcmEvent
|
||||||
import kr.co.vividnext.sodalive.fcm.FcmEventType
|
import kr.co.vividnext.sodalive.fcm.FcmEventType
|
||||||
import kr.co.vividnext.sodalive.member.Member
|
import kr.co.vividnext.sodalive.member.Member
|
||||||
import kr.co.vividnext.sodalive.member.block.BlockMemberRepository
|
|
||||||
import org.springframework.beans.factory.annotation.Value
|
import org.springframework.beans.factory.annotation.Value
|
||||||
import org.springframework.context.ApplicationEventPublisher
|
import org.springframework.context.ApplicationEventPublisher
|
||||||
import org.springframework.data.domain.Pageable
|
import org.springframework.data.domain.Pageable
|
||||||
|
@ -17,7 +16,6 @@ import org.springframework.transaction.annotation.Transactional
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
class AudioContentCommentService(
|
class AudioContentCommentService(
|
||||||
private val repository: AudioContentCommentRepository,
|
private val repository: AudioContentCommentRepository,
|
||||||
private val blockMemberRepository: BlockMemberRepository,
|
|
||||||
private val audioContentRepository: AudioContentRepository,
|
private val audioContentRepository: AudioContentRepository,
|
||||||
private val applicationEventPublisher: ApplicationEventPublisher,
|
private val applicationEventPublisher: ApplicationEventPublisher,
|
||||||
|
|
||||||
|
@ -29,10 +27,6 @@ class AudioContentCommentService(
|
||||||
val audioContent = audioContentRepository.findByIdOrNull(id = audioContentId)
|
val audioContent = audioContentRepository.findByIdOrNull(id = audioContentId)
|
||||||
?: throw SodaException("잘못된 콘텐츠 입니다.\n다시 시도해 주세요.")
|
?: throw SodaException("잘못된 콘텐츠 입니다.\n다시 시도해 주세요.")
|
||||||
|
|
||||||
val creator = audioContent.member!!
|
|
||||||
val isBlocked = blockMemberRepository.isBlocked(blockedMemberId = member.id!!, memberId = creator.id!!)
|
|
||||||
if (isBlocked) throw SodaException("${creator.nickname}님의 요청으로 댓글쓰기가 제한됩니다.")
|
|
||||||
|
|
||||||
val audioContentComment = AudioContentComment(comment = comment)
|
val audioContentComment = AudioContentComment(comment = comment)
|
||||||
audioContentComment.audioContent = audioContent
|
audioContentComment.audioContent = audioContent
|
||||||
audioContentComment.member = member
|
audioContentComment.member = member
|
||||||
|
|
Loading…
Reference in New Issue