feat(contentpreference): 본인인증 후 요청한 콘텐츠 선호값을 저장한다

This commit is contained in:
2026-10-12 13:27:38 +09:00
parent 31167cba1b
commit 6115792dcd
3 changed files with 165 additions and 7 deletions
@@ -129,14 +129,28 @@ class MemberContentPreferenceService(
}
@Transactional
fun markAdultVisibleAfterAuthVerify(memberId: Long) {
fun markAdultVisibleAfterAuthVerify(
memberId: Long,
isAdultContentVisible: Boolean = true,
contentType: ContentType = ContentType.ALL
) {
val member = memberRepository.findByIdOrNull(memberId)
?: throw SodaException(messageKey = "common.error.bad_credentials")
val preference = initializeDefaultPreference(member)
if (!preference.isAdultContentVisible) {
preference.isAdultContentVisible = true
preference.adultContentVisibilityChangedAt = LocalDateTime.now()
val now = LocalDateTime.now()
var hasChanged = false
if (preference.isAdultContentVisible != isAdultContentVisible) {
preference.isAdultContentVisible = isAdultContentVisible
preference.adultContentVisibilityChangedAt = now
hasChanged = true
}
if (preference.contentType != contentType) {
preference.contentType = contentType
preference.contentTypeChangedAt = now
hasChanged = true
}
if (hasChanged) {
evictRecommendLiveCacheAfterCommit(memberId)
}
}