Skip to content

Commit 67bc93f

Browse files
authored
Merge pull request #391 from GSM-MSG/feature/390-authentication-sort
section과 field를 조회할때 sort 컬럼을 오름차순 정렬 합니다
2 parents 1473697 + 78d3831 commit 67bc93f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

sms-persistence/src/main/kotlin/team/msg/sms/persistence/authentication/AuthenticationFieldPersistenceAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AuthenticationFieldPersistenceAdapter(
1313
private val authenticationFieldJpaRepository: AuthenticationFieldJpaRepository
1414
) : AuthenticationFieldPort {
1515
override fun queryAuthenticationFieldsByGroupId(groupId: UUID): List<AuthenticationField> =
16-
authenticationFieldJpaRepository.findAllByGroupId(groupId).map { it.toDomain() }
16+
authenticationFieldJpaRepository.findAllByGroupIdOrderBySortAsc(groupId).map { it.toDomain() }
1717

1818

1919
override fun save(authenticationField: AuthenticationField): AuthenticationField =
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package team.msg.sms.persistence.authentication.repository
22

3+
import org.springframework.boot.autoconfigure.data.web.SpringDataWebProperties.Sort
34
import org.springframework.data.repository.CrudRepository
45
import org.springframework.stereotype.Repository
56
import team.msg.sms.persistence.authentication.entity.AuthenticationFieldJpaEntity
67
import java.util.UUID
78

89
@Repository
910
interface AuthenticationFieldJpaRepository: CrudRepository<AuthenticationFieldJpaEntity, UUID> {
10-
fun findAllByGroupId(groupId: UUID): List<AuthenticationFieldJpaEntity>
11+
fun findAllByGroupIdOrderBySortAsc(groupId: UUID): List<AuthenticationFieldJpaEntity>
1112
}

sms-persistence/src/main/kotlin/team/msg/sms/persistence/authentication/repository/queryDSL/AuthenticationSectionRepositoryImpl.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class AuthenticationSectionRepositoryImpl(
1717
.select(qAuthenticationSection)
1818
.from(qAuthenticationSection)
1919
.where(qAuthenticationSection.groupId.`in`(groupIds))
20+
.orderBy(qAuthenticationSection.sort.asc())
2021
.fetch()
2122
.toList()
2223
}

0 commit comments

Comments
 (0)