feat(i18n): 번역 작업 큐와 언어 감지 캐시를 도입한다
조회 중 외부 번역 호출을 줄이고 누락 번역을 비동기 job으로 처리한다.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package kr.co.vividnext.sodalive.content
|
||||
|
||||
import kr.co.vividnext.sodalive.common.BaseEntity
|
||||
import kr.co.vividnext.sodalive.i18n.translation.SourceTextNormalizer
|
||||
import javax.persistence.Column
|
||||
import javax.persistence.Entity
|
||||
import javax.persistence.Table
|
||||
import javax.persistence.UniqueConstraint
|
||||
|
||||
@Entity
|
||||
@Table(
|
||||
name = "language_detection_result",
|
||||
uniqueConstraints = [
|
||||
UniqueConstraint(
|
||||
name = "uk_language_detection_result_hash_provider_version",
|
||||
columnNames = ["source_hash", "provider", "normalization_version"]
|
||||
)
|
||||
]
|
||||
)
|
||||
class LanguageDetectionResult(
|
||||
@Column(name = "source_hash", nullable = false, length = 64)
|
||||
val sourceHash: String,
|
||||
|
||||
@Column(name = "source_text_sample", nullable = false, length = 500)
|
||||
val sourceTextSample: String,
|
||||
|
||||
@Column(name = "detected_language", nullable = false, length = 10)
|
||||
val detectedLanguage: String,
|
||||
|
||||
@Column(name = "provider", nullable = false, length = 50)
|
||||
val provider: String,
|
||||
|
||||
@Column(name = "confidence")
|
||||
val confidence: Double? = null,
|
||||
|
||||
@Column(name = "normalization_version", nullable = false, length = 20)
|
||||
val normalizationVersion: String = SourceTextNormalizer.NORMALIZATION_VERSION
|
||||
) : BaseEntity()
|
||||
Reference in New Issue
Block a user