feat(recommend): 콘텐츠 조회 이력 모델을 추가한다

This commit is contained in:
2026-05-31 18:18:23 +09:00
parent 24429abe38
commit 70832a10b9
3 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package kr.co.vividnext.sodalive.v2.recommend.adapter.out.persistence
import kr.co.vividnext.sodalive.common.BaseEntity
import java.time.LocalDateTime
import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.Table
@Entity
@Table(name = "creator_content_view_history")
class CreatorContentViewHistory(
@Column(name = "member_id", nullable = false, updatable = false)
val memberId: Long,
@Column(name = "content_id", nullable = false, updatable = false)
val contentId: Long,
@Column(name = "genre_id", nullable = false, updatable = false)
val genreId: Long,
@Column(name = "viewed_at", nullable = false, updatable = false)
val viewedAt: LocalDateTime
) : BaseEntity()

View File

@@ -0,0 +1,5 @@
package kr.co.vividnext.sodalive.v2.recommend.adapter.out.persistence
import org.springframework.data.jpa.repository.JpaRepository
interface CreatorContentViewHistoryRepository : JpaRepository<CreatorContentViewHistory, Long>

View File

@@ -0,0 +1,16 @@
package kr.co.vividnext.sodalive.v2.recommend.port.out
import java.time.LocalDateTime
interface CreatorContentViewHistoryPort {
fun findGenreIdByContentId(contentId: Long): Long?
fun save(record: CreatorContentViewHistoryRecord)
}
data class CreatorContentViewHistoryRecord(
val memberId: Long,
val contentId: Long,
val genreId: Long,
val viewedAt: LocalDateTime
)