Skip to content

Commit

Permalink
Merge branch 'develop' into fix/add-studentClubsDto-engName
Browse files Browse the repository at this point in the history
  • Loading branch information
skfotakf authored Mar 12, 2024
2 parents 179e035 + 39ce4b7 commit f61b158
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package com.wafflestudio.csereal.core.academics.dto

import com.wafflestudio.csereal.core.academics.database.AcademicsEntity
import com.wafflestudio.csereal.core.resource.attachment.dto.AttachmentResponse

class DegreeRequirementsDto(
val year: Int,
val description: String
val description: String,
val attachments: List<AttachmentResponse>

) {
companion object {
fun of(entity: AcademicsEntity) = entity.run {
fun of(entity: AcademicsEntity, attachments: List<AttachmentResponse>) = entity.run {
DegreeRequirementsDto(
year = this.year!!,
description = this.description
description = this.description,
attachments = attachments
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class DegreeRequirementsPageResponse(
val yearList: List<DegreeRequirementsDto>
) {
companion object {
fun of(entity: AcademicsEntity, yearList: List<AcademicsEntity>) = entity.run {
fun of(entity: AcademicsEntity, yearList: List<DegreeRequirementsDto>) = entity.run {
DegreeRequirementsPageResponse(
description = this.description,
yearList = yearList.map { DegreeRequirementsDto.of(it) }
yearList = yearList
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ class AcademicsServiceImpl(
enumLanguageType,
AcademicsStudentType.UNDERGRADUATE,
AcademicsPostType.DEGREE_REQUIREMENTS_YEAR_LIST
)
).map {
val attachments = attachmentService.createAttachmentResponses(it.attachments)
DegreeRequirementsDto.of(it, attachments)
}

return DegreeRequirementsPageResponse.of(academicsEntity, yearList)
}
Expand Down

0 comments on commit f61b158

Please sign in to comment.