diff --git a/src/main/kotlin/com/asap/asapbackend/domain/classroom/domain/repository/ClassroomAnnouncementRepository.kt b/src/main/kotlin/com/asap/asapbackend/domain/classroom/domain/repository/ClassroomAnnouncementRepository.kt index dd3ea7d7..29c3d6f8 100644 --- a/src/main/kotlin/com/asap/asapbackend/domain/classroom/domain/repository/ClassroomAnnouncementRepository.kt +++ b/src/main/kotlin/com/asap/asapbackend/domain/classroom/domain/repository/ClassroomAnnouncementRepository.kt @@ -6,5 +6,5 @@ import org.springframework.data.jpa.repository.JpaRepository interface ClassroomAnnouncementRepository: JpaRepository { fun findTopByClassroomIdOrderByCreatedAtDesc(classroomId : Long) : ClassroomAnnouncement? - fun findAllByClassroomId(classroomId : Long) : List + fun findAllByClassroomIdOrderByCreatedAtDesc(classroomId : Long) : List } \ No newline at end of file diff --git a/src/main/kotlin/com/asap/asapbackend/domain/classroom/domain/service/ClassroomAnnouncementReader.kt b/src/main/kotlin/com/asap/asapbackend/domain/classroom/domain/service/ClassroomAnnouncementReader.kt index fd48fe64..68078d02 100644 --- a/src/main/kotlin/com/asap/asapbackend/domain/classroom/domain/service/ClassroomAnnouncementReader.kt +++ b/src/main/kotlin/com/asap/asapbackend/domain/classroom/domain/service/ClassroomAnnouncementReader.kt @@ -15,7 +15,7 @@ class ClassroomAnnouncementReader( } fun findAllByClassroomId(classroomId: Long): List { - return classroomAnnouncementRepository.findAllByClassroomId(classroomId) + return classroomAnnouncementRepository.findAllByClassroomIdOrderByCreatedAtDesc(classroomId) } fun findById(classroomAnnouncementId: Long) : ClassroomAnnouncement {