콘텐츠 메인 - 추천시리즈, 새로운 콘텐츠, 큐레이션
- 남성향이면 여성 크리에이터, 여성향이면 남성 크리에이터 작품이 조회되도록 수정
This commit is contained in:
@@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.content.theme
|
||||
|
||||
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||
import kr.co.vividnext.sodalive.common.SodaException
|
||||
import kr.co.vividnext.sodalive.content.ContentType
|
||||
import kr.co.vividnext.sodalive.content.SortType
|
||||
import kr.co.vividnext.sodalive.member.Member
|
||||
import org.springframework.data.domain.Pageable
|
||||
@@ -30,6 +31,8 @@ class AudioContentThemeController(private val service: AudioContentThemeService)
|
||||
fun getContentByTheme(
|
||||
@PathVariable id: Long,
|
||||
@RequestParam("sort-type", required = false) sortType: SortType? = SortType.NEWEST,
|
||||
@RequestParam("isAdultContentVisible", required = false) isAdultContentVisible: Boolean? = null,
|
||||
@RequestParam("contentType", required = false) contentType: ContentType? = null,
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?,
|
||||
pageable: Pageable
|
||||
) = run {
|
||||
@@ -39,6 +42,8 @@ class AudioContentThemeController(private val service: AudioContentThemeService)
|
||||
service.getContentByTheme(
|
||||
themeId = id,
|
||||
sortType = sortType ?: SortType.NEWEST,
|
||||
isAdultContentVisible = isAdultContentVisible ?: true,
|
||||
contentType = contentType ?: ContentType.ALL,
|
||||
member = member,
|
||||
offset = pageable.offset,
|
||||
limit = pageable.pageSize.toLong()
|
||||
|
@@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.content.theme
|
||||
|
||||
import kr.co.vividnext.sodalive.common.SodaException
|
||||
import kr.co.vividnext.sodalive.content.AudioContentRepository
|
||||
import kr.co.vividnext.sodalive.content.ContentType
|
||||
import kr.co.vividnext.sodalive.content.SortType
|
||||
import kr.co.vividnext.sodalive.content.theme.content.GetContentByThemeResponse
|
||||
import kr.co.vividnext.sodalive.member.Member
|
||||
@@ -28,6 +29,8 @@ class AudioContentThemeService(
|
||||
fun getContentByTheme(
|
||||
themeId: Long,
|
||||
sortType: SortType,
|
||||
isAdultContentVisible: Boolean,
|
||||
contentType: ContentType,
|
||||
member: Member,
|
||||
offset: Long,
|
||||
limit: Long
|
||||
@@ -38,7 +41,8 @@ class AudioContentThemeService(
|
||||
val totalCount = contentRepository.totalCountByTheme(
|
||||
memberId = member.id!!,
|
||||
theme = theme.theme,
|
||||
isAdult = member.auth != null
|
||||
isAdult = member.auth != null && isAdultContentVisible,
|
||||
contentType = contentType
|
||||
)
|
||||
|
||||
val items = contentRepository.findByTheme(
|
||||
@@ -46,7 +50,8 @@ class AudioContentThemeService(
|
||||
memberId = member.id!!,
|
||||
theme = theme.theme,
|
||||
sortType = sortType,
|
||||
isAdult = member.auth != null,
|
||||
isAdult = member.auth != null && isAdultContentVisible,
|
||||
contentType = contentType,
|
||||
offset = offset,
|
||||
limit = limit
|
||||
)
|
||||
|
Reference in New Issue
Block a user