Files
sodalive-backend-spring-boot/src/main/kotlin/kr/co/vividnext/sodalive/content/ContentPriceChangeLog.kt
Klaus e3f65c8941 크리에이터 관리자 - 콘텐츠 수정
- 가격 수정시 변경사항 로그로 기록
2024-05-29 15:16:24 +09:00

30 lines
782 B
Kotlin

package kr.co.vividnext.sodalive.content
import java.time.LocalDateTime
import javax.persistence.Entity
import javax.persistence.FetchType
import javax.persistence.GeneratedValue
import javax.persistence.GenerationType
import javax.persistence.Id
import javax.persistence.JoinColumn
import javax.persistence.ManyToOne
import javax.persistence.PrePersist
@Entity
data class ContentPriceChangeLog(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
var id: Long? = null,
val prevPrice: Int,
var createdAt: LocalDateTime? = null
) {
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "content_id", nullable = false)
var audioContent: AudioContent? = null
@PrePersist
fun prePersist() {
createdAt = LocalDateTime.now()
}
}