Compare commits

..

No commits in common. "f4618877d48c62933763fa2c0738848be6a7bd03" and "2b914fd222e453b3b4b0b31361fb2ba8cff379b5" have entirely different histories.

11 changed files with 34 additions and 47 deletions

View File

@ -67,21 +67,20 @@ class AudioContentCommentService(
val audioContentComment = repository.findByIdOrNull(request.commentId)
?: throw SodaException("잘못된 접근 입니다.\n확인 후 다시 시도해 주세요.")
if (audioContentComment.member!!.id!! == member.id!!) {
if (audioContentComment.audioContent!!.member!!.id!! != member.id!!) {
if (audioContentComment.member == null || audioContentComment.member!!.id!! != member.id!!) {
throw SodaException("잘못된 접근 입니다.\n확인 후 다시 시도해 주세요.")
}
if (request.comment != null) {
audioContentComment.comment = request.comment
}
}
if (
audioContentComment.member!!.id!! == member.id!! ||
audioContentComment.audioContent!!.member!!.id!! != member.id!!
) {
if (request.isActive != null) {
audioContentComment.isActive = request.isActive
}
}
}
fun getCommentList(audioContentId: Long, timezone: String, pageable: Pageable): GetAudioContentCommentListResponse {
val commentList =

View File

@ -10,7 +10,6 @@ data class GetAudioContentOrderListResponse(
data class GetAudioContentOrderListItem @QueryProjection constructor(
val contentId: Long,
val coverImageUrl: String,
val creatorNickname: String,
val title: String,
val themeStr: String,
val duration: String?,

View File

@ -126,7 +126,6 @@ class OrderQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : Orde
QGetAudioContentOrderListItem(
audioContent.id,
audioContent.coverImage.prepend("/").prepend(coverImageHost),
audioContent.member.nickname,
audioContent.title,
audioContent.theme.theme,
audioContent.duration,

View File

@ -451,7 +451,6 @@ class ExplorerQueryRepository(
GetCheersResponseItem(
cheersId = it.id!!,
memberId = it.member!!.id!!,
nickname = it.member!!.nickname,
profileUrl = if (it.member!!.profileImage != null) {
"$cloudFrontHost/${it.member!!.profileImage}"
@ -468,7 +467,6 @@ class ExplorerQueryRepository(
GetCheersResponseItem(
cheersId = cheers.id!!,
memberId = cheers.member!!.id!!,
nickname = cheers.member!!.nickname,
profileUrl = if (cheers.member!!.profileImage != null) {
"$cloudFrontHost/${cheers.member!!.profileImage}"
@ -595,10 +593,13 @@ class ExplorerQueryRepository(
.fetchFirst()
}
fun getCheers(cheersId: Long): CreatorCheers? {
fun getCheers(cheersId: Long, memberId: Long): CreatorCheers? {
return queryFactory
.selectFrom(creatorCheers)
.where(creatorCheers.id.eq(cheersId))
.where(
creatorCheers.id.eq(cheersId)
.and(creatorCheers.member.id.eq(memberId))
)
.fetchFirst()
}

View File

@ -368,24 +368,11 @@ class ExplorerService(
@Transactional
fun modifyCheers(request: PutWriteCheersRequest, member: Member) {
val cheers = queryRepository.getCheers(request.cheersId)
val cheers = queryRepository.getCheers(request.cheersId, member.id!!)
?: throw SodaException("잘못된 요청입니다.")
if (cheers.member!!.id!! == member.id!!) {
if (request.content != null) {
cheers.cheers = request.content
}
}
if (
cheers.creator!!.id!! == member.id!! ||
cheers.member!!.id!! == member.id!!
) {
if (request.isActive != null) {
cheers.isActive = request.isActive
}
}
}
@Transactional
fun saveNotice(member: Member, notice: String) {

View File

@ -7,7 +7,6 @@ data class GetCheersResponse(
data class GetCheersResponseItem(
val cheersId: Long,
val memberId: Long,
val nickname: String,
val profileUrl: String,
val content: String,

View File

@ -13,7 +13,7 @@ import javax.persistence.OneToMany
data class CreatorCheers(
@Column(columnDefinition = "TEXT", nullable = false)
var cheers: String,
var isActive: Boolean = true
val isActive: Boolean = true
) : BaseEntity() {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "parent_id", nullable = true)

View File

@ -2,6 +2,5 @@ package kr.co.vividnext.sodalive.explorer.profile
data class PutWriteCheersRequest(
val cheersId: Long,
val content: String? = null,
val isActive: Boolean? = null
val content: String
)

View File

@ -2,7 +2,6 @@ package kr.co.vividnext.sodalive.fcm
import kr.co.vividnext.sodalive.content.comment.AudioContentCommentRepository
import kr.co.vividnext.sodalive.member.MemberRepository
import org.slf4j.LoggerFactory
import org.springframework.scheduling.annotation.Async
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Propagation
@ -35,8 +34,6 @@ class FcmSendListener(
private val memberRepository: MemberRepository,
private val contentCommentRepository: AudioContentCommentRepository
) {
private val logger = LoggerFactory.getLogger(this::class.java)
@Async
@TransactionalEventListener
@Transactional(propagation = Propagation.REQUIRES_NEW)
@ -120,12 +117,10 @@ class FcmSendListener(
if (fcmEvent.container.isNotBlank()) {
val pushTokens = memberRepository.getStartLiveRoomNotificationRecipientPushTokens(
creatorId = fcmEvent.creatorId!!,
roomId = fcmEvent.roomId!!,
isAuth = fcmEvent.isAuth,
container = fcmEvent.container
)
logger.info("토큰 - $pushTokens")
for (tokens in pushTokens) {
pushService.send(
tokens = tokens,

View File

@ -250,7 +250,7 @@ class LiveRoomService(
message = if (createdRoom.channelName != null) {
"라이브를 시작했습니다. - ${createdRoom.title}"
} else {
"라이브를 예약했습니다. - ${createdRoom.title}"
"라이브를 개설했습니다. - ${createdRoom.title}"
},
isAuth = createdRoom.isAdult,
roomId = createdRoom.id,
@ -266,7 +266,7 @@ class LiveRoomService(
message = if (createdRoom.channelName != null) {
"라이브를 시작했습니다. - ${createdRoom.title}"
} else {
"라이브를 예약했습니다. - ${createdRoom.title}"
"라이브를 개설했습니다. - ${createdRoom.title}"
},
isAuth = createdRoom.isAdult,
roomId = createdRoom.id,

View File

@ -34,7 +34,6 @@ interface MemberQueryRepository {
fun getStartLiveRoomNotificationRecipientPushTokens(
creatorId: Long,
roomId: Long,
isAuth: Boolean,
container: String
): List<List<String>>
@ -147,10 +146,12 @@ class MemberQueryRepositoryImpl(
override fun getStartLiveRoomNotificationRecipientPushTokens(
creatorId: Long,
roomId: Long,
isAuth: Boolean,
container: String
): List<List<String>> {
val member = QMember.member
val creator = QMember.member
var where = creatorFollowing.isActive.isTrue
.and(creatorFollowing.creator.id.eq(creatorId))
.and(creatorFollowing.member.notification.live.isTrue)
@ -164,21 +165,26 @@ class MemberQueryRepositoryImpl(
.and(creatorFollowing.member.pushToken.isNotNull)
if (isAuth) {
where = where.and(creatorFollowing.member.auth.isNotNull)
where = where.and(member.auth.isNotNull)
}
val followingMemberPushToken = queryFactory
.select(creatorFollowing.member.pushToken)
.from(creatorFollowing)
.innerJoin(creatorFollowing.creator, creator)
.innerJoin(creatorFollowing.member, member)
.innerJoin(member.notification, memberNotification)
.leftJoin(member.auth, auth)
.where(where)
.fetch()
.toSet()
.chunked(500)
where = liveReservation.isActive.isTrue
.and(liveReservation.member.notification.live.isTrue)
.and(liveReservation.member.container.eq(container))
.and(liveReservation.member.email.notIn("admin@sodalive.net"))
.and(liveReservation.member.pushToken.isNotNull)
.and(liveReservation.room.id.eq(roomId))
.and(
liveReservation.member.id.notIn(
blockMemberRepository.getBlockedMemberList(creatorId)
@ -186,18 +192,21 @@ class MemberQueryRepositoryImpl(
)
if (isAuth) {
where = where.and(liveReservation.member.auth.isNotNull)
where = where.and(member.auth.isNotNull)
}
val reservationMemberPushToken = queryFactory
.select(liveReservation.member.pushToken)
.from(liveReservation)
.innerJoin(liveReservation.member, member)
.innerJoin(liveReservation.room, liveRoom)
.innerJoin(liveRoom.member, creator)
.where(where)
.fetch()
return (followingMemberPushToken + reservationMemberPushToken)
.toSet()
.chunked(500)
return followingMemberPushToken + reservationMemberPushToken
}
override fun getUploadContentNotificationRecipientPushTokens(