feat(creator-community): 본문 언어와 개정 저장 기반을 추가한다
This commit is contained in:
+5
-1
@@ -24,7 +24,11 @@ class CreatorCommunity(
|
||||
var isActive: Boolean = true,
|
||||
var isFixed: Boolean = false,
|
||||
@Column(nullable = true)
|
||||
var fixedAt: LocalDateTime? = null
|
||||
var fixedAt: LocalDateTime? = null,
|
||||
@Column(name = "language_code", nullable = true, length = 10)
|
||||
var languageCode: String? = null,
|
||||
@Column(name = "content_revision", nullable = false)
|
||||
var contentRevision: Long = 0
|
||||
) : BaseEntity() {
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "member_id", nullable = false)
|
||||
|
||||
+17
@@ -7,12 +7,29 @@ import kr.co.vividnext.sodalive.explorer.profile.creatorCommunity.QCreatorCommun
|
||||
import kr.co.vividnext.sodalive.member.QMember.member
|
||||
import kr.co.vividnext.sodalive.member.following.QCreatorFollowing.creatorFollowing
|
||||
import org.springframework.data.jpa.repository.JpaRepository
|
||||
import org.springframework.data.jpa.repository.Lock
|
||||
import org.springframework.data.jpa.repository.Query
|
||||
import org.springframework.data.repository.query.Param
|
||||
import java.time.LocalDate
|
||||
import java.time.LocalDateTime
|
||||
import java.time.LocalTime
|
||||
import javax.persistence.LockModeType
|
||||
|
||||
interface CreatorCommunityRepository : JpaRepository<CreatorCommunity, Long>, CreatorCommunityQueryRepository {
|
||||
fun countByMemberIdAndIsFixedIsTrueAndIsActiveIsTrue(memberId: Long): Long
|
||||
|
||||
fun findByIdAndIsActiveTrue(postId: Long): CreatorCommunity?
|
||||
|
||||
@Lock(LockModeType.PESSIMISTIC_WRITE)
|
||||
@Query("select c from CreatorCommunity c where c.id = :postId and c.isActive = true")
|
||||
fun findByIdAndIsActiveTrueForUpdate(@Param("postId") postId: Long): CreatorCommunity?
|
||||
|
||||
@Lock(LockModeType.PESSIMISTIC_WRITE)
|
||||
@Query("select c from CreatorCommunity c where c.id = :postId and c.member.id = :memberId")
|
||||
fun findByIdAndMemberIdForUpdate(
|
||||
@Param("postId") postId: Long,
|
||||
@Param("memberId") memberId: Long
|
||||
): CreatorCommunity?
|
||||
}
|
||||
|
||||
interface CreatorCommunityQueryRepository {
|
||||
|
||||
Reference in New Issue
Block a user