Skip to content

Commit

Permalink
Merge pull request #46 from Workout-Study/dev
Browse files Browse the repository at this point in the history
Proceeding Fit Certification List By fit group id add multiMediaEndPoint
  • Loading branch information
12OneTwo12 authored Jul 26, 2024
2 parents f34da27 + 0287d89 commit cd09dcb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ data class FitCertificationDetailWithVoteResponseDto(
val maxAgreeCount: Int,
val fitRecordStartDate: Instant,
val fitRecordEndDate: Instant,
val thumbnailEndPoint: String?,
val multiMediaEndPoints: List<String>?,
val voteEndDate: Instant
)
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ class FitCertificationService(
val fitCertificationDetailDtoList = fitCertificationDetailList.map {
val userForRead = getUserForReadPort(it.certificationRequestUserId)

val fitRecord = readFitRecordPort.findById(it.recordId)
.orElseThrow { ResourceNotFoundException("fit record does not exist") }

FitCertificationDetailWithVoteResponseDto(
it.certificationId,
it.recordId,
Expand All @@ -145,7 +148,8 @@ class FitCertificationService(
it.maxAgreeCount.toInt(),
it.fitRecordStartDate,
it.fitRecordEndDate,
getRecordThumbnailEndPoint(it.recordId),
readRecordMultiMediaEndPointPort.findByFitRecordAndOrderByIdAsc(fitRecord).stream()
.map { multiMedia -> multiMedia.endPoint }.toList(),
it.createdAt.plus(12, ChronoUnit.HOURS)
)
}.toList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class FitCertificationFilterControllerTest {
i + 13,
Instant.now(),
Instant.now().plusSeconds(10000),
"https://avatars.githubusercontent.com/u/105261146?v=4",
listOf("https://avatars.githubusercontent.com/u/105261146?v=4"),
Instant.now().plusSeconds(1000000)
)
)
Expand Down Expand Up @@ -119,8 +119,8 @@ class FitCertificationFilterControllerTest {
.description("반대 수"),
fieldWithPath("fitCertificationDetails[].maxAgreeCount").type(JsonFieldType.NUMBER)
.description("최대 투표 수"),
fieldWithPath("fitCertificationDetails[].thumbnailEndPoint").type(JsonFieldType.STRING)
.description("기록 썸네일 사진"),
fieldWithPath("fitCertificationDetails[].multiMediaEndPoints[]").type(JsonFieldType.ARRAY)
.description("기록 사진들"),
fieldWithPath("fitCertificationDetails[].fitRecordStartDate").type(JsonFieldType.STRING)
.description("기록 시작 일자"),
fieldWithPath("fitCertificationDetails[].fitRecordEndDate").type(JsonFieldType.STRING)
Expand Down

0 comments on commit cd09dcb

Please sign in to comment.