-
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 #98 from KUSITMS-29th-TEAM-B/feat/flight-84
feat: 자기소개서 수정 API 구현
- Loading branch information
Showing
15 changed files
with
235 additions
and
36 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
6 changes: 5 additions & 1 deletion
6
...scription/application/dto/GetApplyInfo.kt → ...bDescription/application/dto/ApplyInfo.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
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
7 changes: 0 additions & 7 deletions
7
...lin/com/bamyanggang/apimodule/domain/jobDescription/application/dto/CreateApplyContent.kt
This file was deleted.
Oops, something went wrong.
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
...com/bamyanggang/apimodule/domain/jobDescription/application/service/ApplyUpdateService.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.service | ||
|
||
import com.bamyanggang.apimodule.domain.jobDescription.application.dto.ApplyInfo | ||
import com.bamyanggang.domainmodule.domain.jobDescription.aggregate.ApplyContent | ||
import com.bamyanggang.domainmodule.domain.jobDescription.service.ApplyModifier | ||
import org.springframework.stereotype.Service | ||
import java.util.* | ||
|
||
@Service | ||
class ApplyUpdateService( | ||
private val applyModifier: ApplyModifier | ||
) { | ||
|
||
fun updateApplyInfo(jobDescriptionId: UUID, request: ApplyInfo.Request) { | ||
applyModifier.modifyApplyInfo( | ||
jobDescriptionId = jobDescriptionId, | ||
applyContentList = request.contents.map { | ||
ApplyContent.create( | ||
question = it.question, | ||
answer = it.answer | ||
) | ||
} | ||
) | ||
} | ||
|
||
} |
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
32 changes: 32 additions & 0 deletions
32
...lin/com/bamyanggang/apimodule/domain/jobDescription/application/ApplyUpdateServiceTest.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,32 @@ | ||
package com.bamyanggang.apimodule.domain.jobDescription.application | ||
|
||
import com.bamyanggang.apimodule.domain.jobDescription.application.dto.ApplyInfo | ||
import com.bamyanggang.apimodule.domain.jobDescription.application.service.ApplyUpdateService | ||
import com.bamyanggang.domainmodule.domain.jobDescription.service.ApplyModifier | ||
import io.kotest.core.spec.style.BehaviorSpec | ||
import io.mockk.mockk | ||
import io.mockk.verify | ||
import java.util.UUID | ||
|
||
class ApplyUpdateServiceTest: BehaviorSpec({ | ||
val applyModifier = mockk<ApplyModifier>(relaxed = true) | ||
val service = ApplyUpdateService(applyModifier) | ||
|
||
given("ApplyUpdateService") { | ||
val jobDescriptionId = UUID.randomUUID() | ||
val request = ApplyInfo.Request( | ||
contents = listOf( | ||
ApplyInfo.ContentInfo( | ||
question = "질문1", | ||
answer = "답변1" | ||
) | ||
) | ||
) | ||
`when`("updateApplyInfo") { | ||
service.updateApplyInfo(jobDescriptionId, request) | ||
then("should update apply info") { | ||
verify { applyModifier.modifyApplyInfo(any(), any()) } | ||
} | ||
} | ||
} | ||
}) |
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
...c/main/kotlin/com/bamyanggang/domainmodule/domain/jobDescription/service/ApplyModifier.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.domainmodule.domain.jobDescription.service | ||
|
||
import com.bamyanggang.domainmodule.domain.jobDescription.aggregate.ApplyContent | ||
import com.bamyanggang.domainmodule.domain.jobDescription.repository.ApplyRepository | ||
import org.springframework.stereotype.Service | ||
import java.util.* | ||
|
||
@Service | ||
class ApplyModifier( | ||
private val applyRepository: ApplyRepository | ||
) { | ||
|
||
fun modifyApplyInfo( | ||
jobDescriptionId: UUID, | ||
applyContentList: List<ApplyContent> | ||
) { | ||
applyRepository | ||
.findByJobDescriptionId(jobDescriptionId) | ||
.update( | ||
contents = applyContentList | ||
) | ||
.also { applyRepository.save(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
Oops, something went wrong.