-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ement-detail 알림장 상세보기
- Loading branch information
Showing
19 changed files
with
253 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
src/main/kotlin/com/asap/asapbackend/domain/classroom/application/dto/GetAnnouncements.kt
This file was deleted.
Oops, something went wrong.
5 changes: 4 additions & 1 deletion
5
...m/application/dto/GetTodayAnnouncement.kt → ...ion/dto/GetClassroomAnnouncementDetail.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package com.asap.asapbackend.domain.classroom.application.dto | ||
|
||
import com.asap.asapbackend.domain.classroom.domain.vo.AnnouncementDescription | ||
import java.time.LocalDate | ||
|
||
class GetTodayAnnouncement { | ||
class GetClassroomAnnouncementDetail { | ||
data class Response( | ||
val teacherName: String, | ||
val writeDate : LocalDate, | ||
val descriptions: List<AnnouncementDescription> | ||
) | ||
} |
24 changes: 24 additions & 0 deletions
24
...kotlin/com/asap/asapbackend/domain/classroom/application/dto/GetClassroomAnnouncements.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.asap.asapbackend.domain.classroom.application.dto | ||
|
||
|
||
import com.asap.asapbackend.domain.classroom.domain.model.ClassroomAnnouncement | ||
import com.asap.asapbackend.domain.classroom.domain.vo.AnnouncementDescription | ||
import java.time.LocalDate | ||
|
||
class GetClassroomAnnouncements { | ||
data class Response( | ||
val teacherName: String, | ||
val announcements : List<AnnouncementInfo> | ||
) | ||
|
||
data class AnnouncementInfo( | ||
val descriptions: List<AnnouncementDescription>, | ||
val writeDate : LocalDate | ||
) | ||
|
||
fun toAnnouncementInfo(classroomAnnouncements: List<ClassroomAnnouncement>) : List<AnnouncementInfo> { | ||
return classroomAnnouncements.map { | ||
AnnouncementInfo(it.descriptions,it.getWriteDate()) | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...in/com/asap/asapbackend/domain/classroom/application/dto/GetTodayClassroomAnnouncement.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.asap.asapbackend.domain.classroom.application.dto | ||
|
||
import com.asap.asapbackend.domain.classroom.domain.model.ClassroomAnnouncement | ||
import com.asap.asapbackend.domain.classroom.domain.vo.AnnouncementDescription | ||
|
||
class GetTodayClassroomAnnouncement { | ||
data class Response( | ||
val announcementId : Long?, | ||
val descriptions: List<AnnouncementDescription> | ||
) | ||
|
||
companion object { | ||
fun convertClassAnnouncementToResponse(classroomAnnouncementQuery: () -> ClassroomAnnouncement?): Response{ | ||
val announcement = classroomAnnouncementQuery() | ||
val descriptions = announcement?.getSubListFromDescription(0,3) ?: emptyList() | ||
return Response(announcement?.id, descriptions) | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../com/asap/asapbackend/domain/classroom/domain/exception/ClassroomAnnouncementException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.asap.asapbackend.domain.classroom.domain.exception | ||
|
||
import com.asap.asapbackend.global.exception.BusinessException | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.http.HttpStatusCode | ||
|
||
sealed class ClassroomAnnouncementException ( | ||
message: String, | ||
errorCode: Int, | ||
httpStatusCode: HttpStatusCode, | ||
): BusinessException(DEFAULT_CODE_PREFIX, errorCode, httpStatusCode, message) { | ||
|
||
class ClassroomAnnouncementNotFound(message: String = "알림장을을 찾을 수 없습니다.") : ClassroomAnnouncementException(message, 1, HttpStatus.NOT_FOUND) | ||
|
||
companion object{ | ||
const val DEFAULT_CODE_PREFIX = "ANNOUNCEMENT" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
.../kotlin/com/asap/asapbackend/domain/classroom/domain/repository/AnnouncementRepository.kt
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
...om/asap/asapbackend/domain/classroom/domain/repository/ClassroomAnnouncementRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.asap.asapbackend.domain.classroom.domain.repository | ||
|
||
import com.asap.asapbackend.domain.classroom.domain.model.ClassroomAnnouncement | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
|
||
interface ClassroomAnnouncementRepository: JpaRepository<ClassroomAnnouncement,Long> { | ||
fun findTopByClassroomIdOrderByCreatedAtDesc(classroomId : Long) : ClassroomAnnouncement? | ||
|
||
fun findAllByClassroomId(classroomId : Long) : List<ClassroomAnnouncement> | ||
} |
Oops, something went wrong.