fix(recommendation): native Boolean 매핑을 보정한다

This commit is contained in:
2026-06-27 10:56:05 +09:00
parent 9c458d0ae1
commit b3cf26119b
2 changed files with 54 additions and 3 deletions

View File

@@ -475,9 +475,9 @@ class DefaultHomeRecommendationQueryRepository(
title = row[4] as String,
price = (row[5] as Number).toInt(),
coverImage = row[6] as String?,
isPointAvailable = row[7] as Boolean,
isAdult = row[8] as Boolean,
isOriginalSeries = row[9] as Boolean
isPointAvailable = row[7].toNativeBoolean(),
isAdult = row[8].toNativeBoolean(),
isOriginalSeries = row[9].toNativeBoolean()
)
}
}
@@ -1185,6 +1185,14 @@ class DefaultHomeRecommendationQueryRepository(
return if (condition == null) this else and(condition)
}
private fun Any?.toNativeBoolean(): Boolean {
return when (this) {
is Boolean -> this
is Number -> this.toInt() != 0
else -> this as Boolean
}
}
private fun includeAdultCommunityCondition(includeAdultCommunities: Boolean): BooleanExpression? {
return if (includeAdultCommunities) null else creatorCommunity.isAdult.isFalse
}