diff --git a/src/main/kotlin/com/hero/alignlab/domain/discussion/domain/Discussion.kt b/src/main/kotlin/com/hero/alignlab/domain/discussion/domain/Discussion.kt index ead8f95..ed2999b 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/discussion/domain/Discussion.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/discussion/domain/Discussion.kt @@ -15,6 +15,7 @@ class Discussion( val uid: Long, @Column(name = "type") + @Enumerated(EnumType.STRING) val type: DiscussionType, @Column(name = "title") diff --git a/src/main/kotlin/com/hero/alignlab/domain/pose/domain/PoseSnapshot.kt b/src/main/kotlin/com/hero/alignlab/domain/pose/domain/PoseSnapshot.kt index 5cf8427..b5b3f01 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/pose/domain/PoseSnapshot.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/pose/domain/PoseSnapshot.kt @@ -20,6 +20,7 @@ data class PoseSnapshot( val score: BigDecimal, @Column(name = "type") + @Enumerated(EnumType.STRING) val type: PoseType, @Column(name = "image_url") diff --git a/src/main/kotlin/com/hero/alignlab/domain/pose/infrastructure/PoseSnapshotRepository.kt b/src/main/kotlin/com/hero/alignlab/domain/pose/infrastructure/PoseSnapshotRepository.kt index 65df63c..f89c66d 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/pose/infrastructure/PoseSnapshotRepository.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/pose/infrastructure/PoseSnapshotRepository.kt @@ -26,7 +26,7 @@ interface PoseSnapshotQRepository { fun countByUidsAndDate(uids: List, date: LocalDate): List } -class PoseSnapshotRepositoryImpl : PoseSnapshotQRepository, QuerydslRepositorySupport(PoseSnapshot::class.java) { +class PoseSnapshotQRepositoryImpl : PoseSnapshotQRepository, QuerydslRepositorySupport(PoseSnapshot::class.java) { @Autowired @Qualifier("heroEntityManager") override fun setEntityManager(entityManager: EntityManager) { @@ -46,12 +46,12 @@ class PoseSnapshotRepositoryImpl : PoseSnapshotQRepository, QuerydslRepositorySu ) .from(qPoseSnapshot) .where( - qPoseSnapshot.uid.`in`(uids) - .and(qPoseSnapshot.createdAt.year().eq(date.year)) - .and(qPoseSnapshot.createdAt.month().eq(date.monthValue)) - .and(qPoseSnapshot.createdAt.dayOfMonth().eq(date.dayOfMonth)) + qPoseSnapshot.uid.`in`(uids), + qPoseSnapshot.createdAt.year().eq(date.year), + qPoseSnapshot.createdAt.month().eq(date.monthValue), + qPoseSnapshot.createdAt.dayOfMonth().eq(date.dayOfMonth) ) - .groupBy(qPoseSnapshot.type) + .groupBy(qPoseSnapshot.uid, qPoseSnapshot.type) .fetch() } } diff --git a/src/main/kotlin/com/hero/alignlab/domain/user/infrastructure/UserInfoRepository.kt b/src/main/kotlin/com/hero/alignlab/domain/user/infrastructure/UserInfoRepository.kt index cf081a3..8f72e4f 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/user/infrastructure/UserInfoRepository.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/user/infrastructure/UserInfoRepository.kt @@ -1,7 +1,10 @@ package com.hero.alignlab.domain.user.infrastructure import com.hero.alignlab.common.encrypt.EncryptData -import com.hero.alignlab.domain.user.domain.* +import com.hero.alignlab.domain.user.domain.QCredentialUserInfo +import com.hero.alignlab.domain.user.domain.QOAuthUserInfo +import com.hero.alignlab.domain.user.domain.QUserInfo +import com.hero.alignlab.domain.user.domain.UserInfo import com.hero.alignlab.domain.user.domain.vo.OAuthProvider import com.querydsl.jpa.impl.JPAQuery import jakarta.persistence.EntityManager @@ -40,8 +43,7 @@ class UserInfoQRepositoryImpl : UserInfoQRepository, QuerydslRepositorySupport(U private val qOAuthUserInfo = QOAuthUserInfo.oAuthUserInfo override fun findByCredential(username: String, password: EncryptData): UserInfo? { - QOAuthUserInfo.oAuthUserInfo - return JPAQuery(entityManager) + return JPAQuery(entityManager) .select(qUserInfo) .from(qUserInfo) .join(qCredentialUserInfo).on(qUserInfo.id.eq(qCredentialUserInfo.uid)) @@ -52,7 +54,7 @@ class UserInfoQRepositoryImpl : UserInfoQRepository, QuerydslRepositorySupport(U } override fun findByOAuth(provider: OAuthProvider, oauthId: String): UserInfo? { - return JPAQuery(entityManager) + return JPAQuery(entityManager) .select(qUserInfo) .from(qUserInfo) .join(qOAuthUserInfo).on(qUserInfo.id.eq(qOAuthUserInfo.uid)) @@ -63,7 +65,7 @@ class UserInfoQRepositoryImpl : UserInfoQRepository, QuerydslRepositorySupport(U } override fun findAllUids(): List { - return JPAQuery(entityManager) + return JPAQuery(entityManager) .select(qUserInfo.id) .from(qUserInfo) .fetch()