feat(recommend): 콘텐츠 조회 이력 모델을 추가한다
This commit is contained in:
@@ -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()
|
||||
@@ -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>
|
||||
@@ -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
|
||||
)
|
||||
Reference in New Issue
Block a user