-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from KUSITMS-29th-TEAM-B/feat/flight-41
feat: 경험 상세 조회 API 구현(#41)
- Loading branch information
Showing
16 changed files
with
180 additions
and
38 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
23 changes: 23 additions & 0 deletions
23
...in/kotlin/com/bamyanggang/apimodule/domain/experience/application/dto/DetailExperience.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,23 @@ | ||
package com.bamyanggang.apimodule.domain.experience.application.dto | ||
|
||
import com.bamyanggang.apimodule.domain.strongpoint.application.dto.GetStrongPoint.DetailStrongPoint | ||
import java.time.LocalDateTime | ||
import java.util.* | ||
|
||
class DetailExperience { | ||
data class Response( | ||
val id: UUID, | ||
val title: String, | ||
val parentTagId: UUID, | ||
val childTagId: UUID, | ||
val strongPoints: List<DetailStrongPoint>, | ||
val contents: List<DetailExperienceContent>, | ||
val startedAt: LocalDateTime, | ||
val endedAt: LocalDateTime, | ||
) | ||
|
||
data class DetailExperienceContent( | ||
val question: String, | ||
val answer: String, | ||
) | ||
} |
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
41 changes: 39 additions & 2 deletions
41
...n/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.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,18 +1,55 @@ | ||
package com.bamyanggang.apimodule.domain.experience.application.service | ||
|
||
import com.bamyanggang.apimodule.common.getAuthenticationPrincipal | ||
import com.bamyanggang.apimodule.domain.experience.application.dto.DetailExperience | ||
import com.bamyanggang.apimodule.domain.experience.application.dto.ExperienceYear | ||
import com.bamyanggang.apimodule.domain.strongpoint.application.dto.GetStrongPoint | ||
import com.bamyanggang.domainmodule.domain.experience.service.ExperienceReader | ||
import com.bamyanggang.domainmodule.domain.strongpoint.service.StrongPointReader | ||
import org.springframework.stereotype.Service | ||
import java.util.* | ||
|
||
@Service | ||
class ExperienceGetService( | ||
private val experienceReader: ExperienceReader | ||
private val experienceReader: ExperienceReader, | ||
private val strongPointReader: StrongPointReader, | ||
) { | ||
fun getExperienceDetailById(experienceId: UUID) : DetailExperience.Response { | ||
val oneExperience = experienceReader.readExperience(experienceId) | ||
|
||
val detailExperienceContents = oneExperience.contents.map { | ||
DetailExperience.DetailExperienceContent( | ||
it.question, | ||
it.answer | ||
) | ||
} | ||
|
||
val strongPointIds = oneExperience.strongPoints.map { it.id } | ||
val strongPointDetails = strongPointReader.readByIds(strongPointIds).map { | ||
GetStrongPoint.DetailStrongPoint( | ||
it.id, | ||
it.name | ||
) | ||
} | ||
|
||
return oneExperience.let { | ||
DetailExperience.Response( | ||
id = it.id, | ||
title = it.title, | ||
parentTagId = it.parentTagId, | ||
childTagId = it.childTagId, | ||
strongPoints = strongPointDetails, | ||
contents = detailExperienceContents, | ||
startedAt = it.startedAt, | ||
endedAt = it.endedAt | ||
) | ||
} | ||
} | ||
|
||
fun getAllYearsByExistExperience(): ExperienceYear.Response { | ||
val currentUserId = getAuthenticationPrincipal() | ||
|
||
return experienceReader.readAllYearsByExistExperience(currentUserId) | ||
.let { ExperienceYear.Response(it) } | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.