-
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 #97 from KUSITMS-29th-TEAM-B/feat/flight-83
feat: 자기소개서 상세 조회 API 구현
- Loading branch information
Showing
12 changed files
with
160 additions
and
8 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
13 changes: 13 additions & 0 deletions
13
...in/kotlin/com/bamyanggang/apimodule/domain/jobDescription/application/dto/GetApplyInfo.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,13 @@ | ||
package com.bamyanggang.apimodule.domain.jobDescription.application.dto | ||
|
||
class GetApplyInfo { | ||
|
||
data class Response( | ||
val applyContentList: List<ContentInfo> | ||
) | ||
|
||
data class ContentInfo( | ||
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
24 changes: 24 additions & 0 deletions
24
...om/bamyanggang/apimodule/domain/jobDescription/application/service/ApplyInfoGetService.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.bamyanggang.apimodule.domain.jobDescription.application.service | ||
|
||
import com.bamyanggang.apimodule.domain.jobDescription.application.dto.GetApplyInfo | ||
import com.bamyanggang.domainmodule.domain.jobDescription.service.ApplyReader | ||
import org.springframework.stereotype.Service | ||
import java.util.* | ||
|
||
@Service | ||
class ApplyInfoGetService( | ||
private val applyReader: ApplyReader | ||
) { | ||
|
||
fun getApplyInfo(jobDescriptionId: UUID): GetApplyInfo.Response { | ||
return applyReader.readApplyByJobDescriptionId(jobDescriptionId).contents.map { | ||
GetApplyInfo.ContentInfo( | ||
it.question, | ||
it.answer | ||
) | ||
}.let { | ||
GetApplyInfo.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
26 changes: 26 additions & 0 deletions
26
.../bamyanggang/apimodule/domain/jobDescription/application/ApplicationInfoGetServiceTest.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,26 @@ | ||
package com.bamyanggang.apimodule.domain.jobDescription.application | ||
|
||
import com.bamyanggang.apimodule.domain.jobDescription.application.service.ApplyInfoGetService | ||
import com.bamyanggang.domainmodule.domain.jobDescription.service.ApplyReader | ||
import io.kotest.core.spec.style.BehaviorSpec | ||
import io.mockk.mockk | ||
import io.mockk.verify | ||
import java.util.UUID | ||
|
||
class ApplicationInfoGetServiceTest: BehaviorSpec({ | ||
val mockApplyReader = mockk<ApplyReader>(relaxed = true) | ||
val service = ApplyInfoGetService(mockApplyReader) | ||
|
||
given("ApplyInfoGetService.getApplyInfo") { | ||
val jobDescriptionId: UUID = UUID.randomUUID() | ||
`when`("jobDescriptionId가 주어지면") { | ||
service.getApplyInfo(jobDescriptionId) | ||
then("readApplyByJobDescriptionId가 호출된다.") { | ||
verify { | ||
mockApplyReader.readApplyByJobDescriptionId(jobDescriptionId) | ||
} | ||
} | ||
} | ||
} | ||
|
||
}) |
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
25 changes: 25 additions & 0 deletions
25
...test/kotlin/com/bamyanggang/domainmodule/domain/jobDescription/service/ApplyReaderTest.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,25 @@ | ||
package com.bamyanggang.domainmodule.domain.jobDescription.service | ||
|
||
import com.bamyanggang.domainmodule.domain.jobDescription.repository.ApplyRepository | ||
import io.kotest.core.spec.style.BehaviorSpec | ||
import io.mockk.mockk | ||
import io.mockk.verify | ||
import java.util.UUID | ||
|
||
class ApplyReaderTest: BehaviorSpec({ | ||
val applyRepository = mockk<ApplyRepository>(relaxed = true) | ||
val applyReader = ApplyReader(applyRepository) | ||
|
||
given("ApplyReader.readApplyByJobDescriptionId") { | ||
val jobDescriptionId: UUID = UUID.randomUUID() | ||
`when`("jobDescriptionId가 주어지면") { | ||
applyReader.readApplyByJobDescriptionId(jobDescriptionId) | ||
then("applyRepository.findByJobDescriptionId가 호출된다.") { | ||
verify { | ||
applyRepository.findByJobDescriptionId(jobDescriptionId) | ||
} | ||
} | ||
} | ||
} | ||
|
||
}) |
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