From f1e8e8a3c22614833ab2d833cee68b473b213755 Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Mon, 20 May 2024 19:27:50 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=EC=97=B0=EB=8F=84,=20=ED=83=9C?= =?UTF-8?q?=EA=B7=B8=20=EB=B3=84=20=EC=97=B0=EB=8F=84=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/ExperienceRepository.kt | 2 ++ .../experience/service/ExperienceReader.kt | 8 ++++++ .../experience/ExperienceRepositoryImpl.java | 25 +++++++++++++++++-- .../repository/ExperienceJpaRepository.java | 2 ++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/repository/ExperienceRepository.kt b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/repository/ExperienceRepository.kt index 7c3a5f4b..f2679125 100644 --- a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/repository/ExperienceRepository.kt +++ b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/repository/ExperienceRepository.kt @@ -9,4 +9,6 @@ interface ExperienceRepository { fun findByExperienceId(id: UUID): Experience fun findAllByUserId(userId: UUID): List fun findByUserIdAndYearDesc(year: Int, userId: UUID): List + fun findByYearAndParentTagId(year: Int, parentTagId: UUID): List + fun findByYearAndChildTagId(year: Int, childTagId: UUID): List } diff --git a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReader.kt b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReader.kt index f0b2754e..29849643 100644 --- a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReader.kt +++ b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReader.kt @@ -29,4 +29,12 @@ class ExperienceReader( fun readByYearDesc(year: Int, userId: UUID): List { return experienceRepository.findByUserIdAndYearDesc(year, userId) } + + fun readByYearAndParentTagId(year: Int, parentTagId: UUID) : List { + return experienceRepository.findByYearAndParentTagId(year, parentTagId) + } + + fun readByYearAndChildTagId(year: Int, childTagId: UUID): List { + return experienceRepository.findByYearAndChildTagId(year, childTagId) + } } diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/ExperienceRepositoryImpl.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/ExperienceRepositoryImpl.java index 48f5aa44..28119760 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/ExperienceRepositoryImpl.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/ExperienceRepositoryImpl.java @@ -6,7 +6,6 @@ import com.bamyanggang.persistence.experience.jpa.entity.ExperienceJpaEntity; import com.bamyanggang.persistence.experience.jpa.repository.ExperienceJpaRepository; import com.bamyanggang.persistence.experience.mapper.ExperienceMapper; -import com.bamyanggang.persistence.user.UserRepositoryImpl; import java.time.LocalDateTime; import java.util.List; import java.util.UUID; @@ -18,7 +17,6 @@ public class ExperienceRepositoryImpl implements ExperienceRepository { private final ExperienceJpaRepository experienceJpaRepository; private final ExperienceMapper experienceMapper; - private final UserRepositoryImpl userRepositoryImpl; @Override public void save(Experience experience) { @@ -49,9 +47,32 @@ public List findAllByUserId(UUID userId) { public List findByUserIdAndYearDesc(int year, UUID userId) { LocalDateTime startYear = LocalDateTime.of(year, 1, 1, 0, 0); LocalDateTime endYear = LocalDateTime.of(year, 12, 31, 23, 59); + List experienceJpaEntities = experienceJpaRepository .findByUserIdAndCreatedAtBetweenOrderByCreatedAtDesc(userId, startYear, endYear); return experienceJpaEntities.stream().map(experienceMapper::toExperienceDomainEntity).toList(); } + + @Override + public List findByYearAndParentTagId(int year, UUID parentTagId) { + LocalDateTime startYear = LocalDateTime.of(year, 1, 1, 0, 0); + LocalDateTime endYear = LocalDateTime.of(year, 12, 31, 23, 59); + + List experienceJpaEntities = experienceJpaRepository + .findByParentTagIdAndCreatedAtBetweenOrderByCreatedAtDesc(parentTagId, startYear, endYear); + + return experienceJpaEntities.stream().map(experienceMapper::toExperienceDomainEntity).toList(); + } + + @Override + public List findByYearAndChildTagId(int year, UUID childTagId) { + LocalDateTime startYear = LocalDateTime.of(year, 1, 1, 0, 0); + LocalDateTime endYear = LocalDateTime.of(year, 12, 31, 23, 59); + + List experienceJpaEntities = experienceJpaRepository + .findByChildTagIdAndCreatedAtBetweenOrderByCreatedAtDesc(childTagId, startYear, endYear); + + return experienceJpaEntities.stream().map(experienceMapper::toExperienceDomainEntity).toList(); + } } diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/jpa/repository/ExperienceJpaRepository.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/jpa/repository/ExperienceJpaRepository.java index 5e2f9694..a8ad4f05 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/jpa/repository/ExperienceJpaRepository.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/jpa/repository/ExperienceJpaRepository.java @@ -9,4 +9,6 @@ public interface ExperienceJpaRepository extends JpaRepository { List findAllByUserId(UUID userId); List findByUserIdAndCreatedAtBetweenOrderByCreatedAtDesc(UUID userId, LocalDateTime startYear, LocalDateTime endYear); + List findByParentTagIdAndCreatedAtBetweenOrderByCreatedAtDesc(UUID parentTagId, LocalDateTime startYear, LocalDateTime endYear); + List findByChildTagIdAndCreatedAtBetweenOrderByCreatedAtDesc(UUID childTagId, LocalDateTime startYear, LocalDateTime endYear); } From 345e5290de957af535c226ba56ead50d1a126fd1 Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Mon, 20 May 2024 19:28:09 +0900 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=EA=B2=BD=ED=97=98=20=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20API=20=EA=B5=AC=ED=98=84(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ExperienceGetService.kt | 81 ++++++++++++------- .../presentation/ExperienceController.kt | 10 +++ 2 files changed, 62 insertions(+), 29 deletions(-) diff --git a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt index 01a7a4b9..16be4926 100644 --- a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt +++ b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt @@ -3,6 +3,7 @@ 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.domainmodule.domain.experience.aggregate.Experience import com.bamyanggang.domainmodule.domain.experience.service.ExperienceReader import com.bamyanggang.domainmodule.domain.strongpoint.service.StrongPointReader import com.bamyanggang.domainmodule.domain.tag.service.TagReader @@ -17,54 +18,76 @@ class ExperienceGetService( ) { fun getExperienceDetailById(experienceId: UUID) : DetailExperience.Response { val oneExperience = experienceReader.readExperience(experienceId) + return createExperienceDetailResponse(oneExperience) + } - val detailExperienceContents = oneExperience.contents.map { - DetailExperience.DetailExperienceContent( - it.question, - it.answer - ) + fun getAllYearsByExistExperience(): ExperienceYear.Response { + val currentUserId = getAuthenticationPrincipal() + + return experienceReader.readAllYearsByExistExperience(currentUserId) + .let { ExperienceYear.Response(it) } + } + + fun getExperienceByYearAndParentTag(year: Int, parentTagId: UUID): List { + return experienceReader.readByYearAndParentTagId(year, parentTagId).map { + createExperienceDetailResponse(it) } + } - val strongPointIds = oneExperience.strongPoints.map { it.strongPointId } - val strongPointDetails = strongPointReader.readByIds(strongPointIds).map { - DetailExperience.DetailStrongPoint( - it.id, - it.name - ) + fun getExperienceByYearAndChildTag(year: Int, childTagId: UUID): List { + return experienceReader.readByYearAndChildTagId(year, childTagId).map { + createExperienceDetailResponse(it) } + } + + private fun createExperienceDetailResponse(it: Experience): DetailExperience.Response { + val detailExperienceContents = convertDetailExperienceContent(it) + val strongPointDetails = convertStrongPoints(it) + val detailParentTag = convertParentTag(it) + val detailChildTag = convertChildTag(it) - val detailParentTag = tagReader.readById(oneExperience.parentTagId).let { + return DetailExperience.Response( + id = it.id, + title = it.title, + parentTag = detailParentTag, + childTag = detailChildTag, + strongPoints = strongPointDetails, + contents = detailExperienceContents, + startedAt = it.startedAt, + endedAt = it.endedAt + ) + } + + private fun convertChildTag(oneExperience: Experience) = + tagReader.readById(oneExperience.childTagId).let { DetailExperience.DetailTag( it.id, it.name ) } - val detailChildTag = tagReader.readById(oneExperience.childTagId).let { + private fun convertParentTag(oneExperience: Experience) = + tagReader.readById(oneExperience.parentTagId).let { DetailExperience.DetailTag( it.id, it.name ) } - return oneExperience.let { - DetailExperience.Response( - id = it.id, - title = it.title, - parentTag = detailParentTag, - childTag = detailChildTag, - strongPoints = strongPointDetails, - contents = detailExperienceContents, - startedAt = it.startedAt, - endedAt = it.endedAt + private fun convertDetailExperienceContent(experience: Experience) = + experience.contents.map { DetailExperience.DetailExperienceContent( + it.question, + it.answer ) } - } - - fun getAllYearsByExistExperience(): ExperienceYear.Response { - val currentUserId = getAuthenticationPrincipal() - return experienceReader.readAllYearsByExistExperience(currentUserId) - .let { ExperienceYear.Response(it) } + private fun convertStrongPoints(experience: Experience) = + experience.strongPoints.map { it.strongPointId }.let { + strongPointReader.readByIds(it).map { strongPoint -> + DetailExperience.DetailStrongPoint( + strongPoint.id, + strongPoint.name + ) + } } } diff --git a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceController.kt b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceController.kt index b20f96bf..d3147c1a 100644 --- a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceController.kt +++ b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceController.kt @@ -18,6 +18,16 @@ class ExperienceController( private val experienceEditService: ExperienceEditService, private val experienceGetService: ExperienceGetService ) { + @GetMapping(ExperienceApi.BASE_URL) + fun getExperienceByFilter(@RequestParam("year") year: Int, + @RequestParam("parent-tag", required = false) parentTagId: UUID, + @RequestParam("child-tag", required = false) childTagId: UUID? + ) : List = + when (childTagId){ + null -> experienceGetService.getExperienceByYearAndParentTag(year, parentTagId) + else -> experienceGetService.getExperienceByYearAndChildTag(year, childTagId) + } + @GetMapping(ExperienceApi.EXPERIENCE_PATH_VARIABLE_URL) fun getExperience(@PathVariable("experienceId") experienceId: UUID): DetailExperience.Response { return experienceGetService.getExperienceDetailById(experienceId) From c0dbcce84835279d5b7fe5b9d734d1ca9eb2de2d Mon Sep 17 00:00:00 2001 From: whereami2048 Date: Mon, 20 May 2024 19:54:45 +0900 Subject: [PATCH 3/5] =?UTF-8?q?test:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1=20=EB=B0=8F=20API=20?= =?UTF-8?q?=EB=AA=85=EC=84=B8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Api-Module/src/docs/asciidoc/Experience.adoc | 5 + .../presentation/ExperienceControllerTest.kt | 166 +++++++++++++++++- .../JobDescriptionControllerTest.kt | 7 +- .../presentation/StrongPointControllerTest.kt | 6 +- 4 files changed, 179 insertions(+), 5 deletions(-) diff --git a/Api-Module/src/docs/asciidoc/Experience.adoc b/Api-Module/src/docs/asciidoc/Experience.adoc index 6d63d2b2..7184e136 100644 --- a/Api-Module/src/docs/asciidoc/Experience.adoc +++ b/Api-Module/src/docs/asciidoc/Experience.adoc @@ -21,6 +21,11 @@ operation::ExperienceControllerTest/deleteExperienceTest/[snippets='http-request operation::ExperienceControllerTest/getExperienceDetailTest/[snippets='http-request,path-parameters,request-headers,request-body,http-response,response-body'] +[[GetExperiencesTest]] +=== 경험 목록 조회 API + +operation::ExperienceControllerTest/getExperienceYearAndChildTagTest/[snippets='http-request,request-headers,request-body,http-response,response-body'] + [[getExperienceYearsTest]] === 유저 경험 내 존재 연도 조회 API diff --git a/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt b/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt index 70fa0130..be796b1e 100644 --- a/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt +++ b/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt @@ -352,12 +352,171 @@ class ExperienceControllerTest : BaseRestDocsTest() { ) ) } - + + @Test + @DisplayName("경험 목록을 상위 태그 id를 기준으로 조회한다.") + fun getExperienceYearAndParentTagTest() { + val content1 = DetailExperience.DetailExperienceContent("질문1", "답변1") + val content2 = DetailExperience.DetailExperienceContent("질문2", "답변2") + val strongPoint1 = DetailExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 1") + val strongPoint2 = DetailExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 2") + val parentTag = DetailExperience.DetailTag(UUID.randomUUID(), "상위 태그 이름") + val childTag = DetailExperience.DetailTag(UUID.randomUUID(), "하위 태그 이름") + val startedAt = LocalDateTime.now() + val endedAt = LocalDateTime.now().plusDays(1) + + val contentResponse = arrayListOf(content1, content2) + val strongPointResponse = arrayListOf(strongPoint1, strongPoint2) + + val experienceResponses = arrayListOf( + DetailExperience.Response( + id = UUID.randomUUID(), + title = "경험 제목1 ", + contents = contentResponse, + strongPoints = strongPointResponse, + parentTag = parentTag, + childTag = childTag, + startedAt = startedAt, + endedAt = endedAt + ), + DetailExperience.Response( + id = UUID.randomUUID(), + title = "경험 제목 2", + contents = contentResponse, + strongPoints = strongPointResponse, + parentTag = parentTag, + childTag = childTag, + startedAt = startedAt.minusYears(1), + endedAt = endedAt + ) + ) + + val year = 2024 + given(experienceGetService.getExperienceByYearAndParentTag(year, parentTag.id)).willReturn(experienceResponses) + + //given + val request = RestDocumentationRequestBuilders.get(ExperienceApi.BASE_URL) + .header("Authorization", "Bearer Access Token") + .contentType(MediaType.APPLICATION_JSON_VALUE) + .queryParam("year", year.toString()) + .queryParam("parent-tag", parentTag.id.toString()) + + //when + val result = mockMvc.perform(request) + + //then + result.andExpect(status().isOk).andDo( + resultHandler.document( + requestHeaders( + headerWithName("Authorization").description("엑세스 토큰") + ), + responseFields( + fieldWithPath("[].id").description("경험 id"), + fieldWithPath("[].title").description("경험 제목"), + fieldWithPath("[].contents").description("경험 내용"), + fieldWithPath("[].contents[].question").description("경험 내용 질문"), + fieldWithPath("[].contents[].answer").description("경험 내용 답변"), + fieldWithPath("[].strongPoints").description("관련된 역량 키워드"), + fieldWithPath("[].strongPoints[].id").description("역량 키워드 id"), + fieldWithPath("[].strongPoints[].name").description("역량 키워드 이름"), + fieldWithPath("[].parentTag").description("속한 상위 태그"), + fieldWithPath("[].parentTag.id").description("상위 태그 id"), + fieldWithPath("[].parentTag.name").description("상위 태그 이름"), + fieldWithPath("[].childTag").description("속한 하위 태그"), + fieldWithPath("[].childTag.id").description("하위 태그 id"), + fieldWithPath("[].childTag.name").description("하위 태그 이름"), + fieldWithPath("[].startedAt").description("경험 시작 날짜"), + fieldWithPath("[].endedAt").description("경험 종료 날짜"), + ), + ) + ) + } + + @Test + @DisplayName("경험 목록을 하위 태그 id를 기준으로 조회한다.") + fun getExperienceYearAndChildTagTest() { + val content1 = DetailExperience.DetailExperienceContent("질문1", "답변1") + val content2 = DetailExperience.DetailExperienceContent("질문2", "답변2") + val strongPoint1 = DetailExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 1") + val strongPoint2 = DetailExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 2") + val parentTag = DetailExperience.DetailTag(UUID.randomUUID(), "상위 태그 이름") + val childTag = DetailExperience.DetailTag(UUID.randomUUID(), "하위 태그 이름") + val startedAt = LocalDateTime.now() + val endedAt = LocalDateTime.now().plusDays(1) + + val contentResponse = arrayListOf(content1, content2) + val strongPointResponse = arrayListOf(strongPoint1, strongPoint2) + + val experienceResponses = arrayListOf( + DetailExperience.Response( + id = UUID.randomUUID(), + title = "경험 제목1 ", + contents = contentResponse, + strongPoints = strongPointResponse, + parentTag = parentTag, + childTag = childTag, + startedAt = startedAt, + endedAt = endedAt + ), + DetailExperience.Response( + id = UUID.randomUUID(), + title = "경험 제목 2", + contents = contentResponse, + strongPoints = strongPointResponse, + parentTag = parentTag, + childTag = childTag, + startedAt = startedAt.minusYears(1), + endedAt = endedAt + ) + ) + + val year = 2024 + given(experienceGetService.getExperienceByYearAndChildTag(year, childTag.id)).willReturn(experienceResponses) + + //given + val request = RestDocumentationRequestBuilders.get(ExperienceApi.BASE_URL) + .header("Authorization", "Bearer Access Token") + .contentType(MediaType.APPLICATION_JSON_VALUE) + .queryParam("year", year.toString()) + .queryParam("parent-tag", parentTag.id.toString()) + .queryParam("child-tag", childTag.id.toString()) + //when + val result = mockMvc.perform(request) + + //then + result.andExpect(status().isOk).andDo( + resultHandler.document( + requestHeaders( + headerWithName("Authorization").description("엑세스 토큰") + ), + responseFields( + fieldWithPath("[].id").description("경험 id"), + fieldWithPath("[].title").description("경험 제목"), + fieldWithPath("[].contents").description("경험 내용"), + fieldWithPath("[].contents[].question").description("경험 내용 질문"), + fieldWithPath("[].contents[].answer").description("경험 내용 답변"), + fieldWithPath("[].strongPoints").description("관련된 역량 키워드"), + fieldWithPath("[].strongPoints[].id").description("역량 키워드 id"), + fieldWithPath("[].strongPoints[].name").description("역량 키워드 이름"), + fieldWithPath("[].parentTag").description("속한 상위 태그"), + fieldWithPath("[].parentTag.id").description("상위 태그 id"), + fieldWithPath("[].parentTag.name").description("상위 태그 이름"), + fieldWithPath("[].childTag").description("속한 하위 태그"), + fieldWithPath("[].childTag.id").description("하위 태그 id"), + fieldWithPath("[].childTag.name").description("하위 태그 이름"), + fieldWithPath("[].startedAt").description("경험 시작 날짜"), + fieldWithPath("[].endedAt").description("경험 종료 날짜"), + ), + ) + ) + } + + @Test @DisplayName("유저의 경험 내 존재하는 연도들을 중복 제거한 리스트를 반환한다.") fun getExperienceYearsTest() { //given val userId: UUID = generateFixture() - val years = arrayListOf(2023, 2024, 2025) + val years = arrayListOf(2020,2021,2023, 2024, 2025) val yearResponse = ExperienceYear.Response(years) given(experienceGetService.getAllYearsByExistExperience()).willReturn(yearResponse) @@ -371,6 +530,9 @@ class ExperienceControllerTest : BaseRestDocsTest() { result.andExpect(status().isOk).andDo( resultHandler.document( + requestHeaders( + headerWithName("Authorization").description("엑세스 토큰") + ), responseFields( fieldWithPath("years").description("경험이 존재하는 연도 배열(활동 시작 일시 기준)") ) diff --git a/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/jobDescription/presentation/JobDescriptionControllerTest.kt b/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/jobDescription/presentation/JobDescriptionControllerTest.kt index 6257df91..46fc9a04 100644 --- a/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/jobDescription/presentation/JobDescriptionControllerTest.kt +++ b/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/jobDescription/presentation/JobDescriptionControllerTest.kt @@ -2,7 +2,10 @@ package com.bamyanggang.apimodule.domain.jobDescription.presentation import com.bamyanggang.apimodule.BaseRestDocsTest import com.bamyanggang.apimodule.common.dto.PageResponse -import com.bamyanggang.apimodule.domain.jobDescription.application.dto.* +import com.bamyanggang.apimodule.domain.jobDescription.application.dto.ApplyInfo +import com.bamyanggang.apimodule.domain.jobDescription.application.dto.CreateApply +import com.bamyanggang.apimodule.domain.jobDescription.application.dto.CreateJobDescription +import com.bamyanggang.apimodule.domain.jobDescription.application.dto.JobDescriptionInfo import com.bamyanggang.apimodule.domain.jobDescription.application.service.* import com.bamyanggang.commonmodule.exception.ExceptionHandler import com.bamyanggang.commonmodule.fixture.generateFixture @@ -416,7 +419,7 @@ class JobDescriptionControllerTest : BaseRestDocsTest() { fun updateApplyInfo() { // given val jobDescriptionId = UUID.randomUUID() - val updateApplyRequest: ApplyInfo.Request = generateFixture { + val updateApplyRequest: ApplyInfo.Request.Update = generateFixture { it.set("contents", listOf(ApplyInfo.ContentInfo("질문", "답변"))) } diff --git a/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/strongpoint/presentation/StrongPointControllerTest.kt b/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/strongpoint/presentation/StrongPointControllerTest.kt index 45d89df1..54ab2771 100644 --- a/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/strongpoint/presentation/StrongPointControllerTest.kt +++ b/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/strongpoint/presentation/StrongPointControllerTest.kt @@ -34,7 +34,11 @@ class StrongPointControllerTest : BaseRestDocsTest() { @Test @DisplayName("역량 키워드를 저장한 뒤 생성된 역량 키워드 정보를 반환한다.") fun createStrongPointTest() { - val createStrongPoint: CreateStrongPoint.Request = generateFixture() + val createStrongPoint = CreateStrongPoint.Request( + arrayListOf( + CreateStrongPoint.StrongPointName("이름 1"), + CreateStrongPoint.StrongPointName("이름 2"), + )) val strongPoints = arrayListOf( CreateStrongPoint.DetailStrongPoint(generateFixture(), "역량 키워드 이름 1"), From 9d760a93e86aec857d4b2adfa37631331dc75aad Mon Sep 17 00:00:00 2001 From: whereami2048 Date: Mon, 20 May 2024 20:20:32 +0900 Subject: [PATCH 4/5] =?UTF-8?q?chore:=20=EB=B3=80=EC=88=98=EB=AA=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ExperienceGetService.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt index 16be4926..d2c0af1e 100644 --- a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt +++ b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt @@ -40,21 +40,21 @@ class ExperienceGetService( } } - private fun createExperienceDetailResponse(it: Experience): DetailExperience.Response { - val detailExperienceContents = convertDetailExperienceContent(it) - val strongPointDetails = convertStrongPoints(it) - val detailParentTag = convertParentTag(it) - val detailChildTag = convertChildTag(it) + private fun createExperienceDetailResponse(experience: Experience): DetailExperience.Response { + val detailExperienceContents = convertDetailExperienceContent(experience) + val strongPointDetails = convertStrongPoints(experience) + val detailParentTag = convertParentTag(experience) + val detailChildTag = convertChildTag(experience) return DetailExperience.Response( - id = it.id, - title = it.title, + id = experience.id, + title = experience.title, parentTag = detailParentTag, childTag = detailChildTag, strongPoints = strongPointDetails, contents = detailExperienceContents, - startedAt = it.startedAt, - endedAt = it.endedAt + startedAt = experience.startedAt, + endedAt = experience.endedAt ) } From 40cffe1c8aa24ea13e48a59e6022a9211cc13f33 Mon Sep 17 00:00:00 2001 From: whereami2048 Date: Mon, 20 May 2024 20:50:27 +0900 Subject: [PATCH 5/5] =?UTF-8?q?refactor:=20=EC=9D=91=EB=8B=B5=20DTO=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=ED=98=95=EC=8B=9D=20=EB=B3=80?= =?UTF-8?q?=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{DetailExperience.kt => GetExperience.kt} | 6 +- .../service/ExperienceGetService.kt | 28 +-- .../presentation/ExperienceController.kt | 11 +- .../presentation/ExperienceControllerTest.kt | 195 +++++++++--------- 4 files changed, 126 insertions(+), 114 deletions(-) rename Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/dto/{DetailExperience.kt => GetExperience.kt} (86%) diff --git a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/dto/DetailExperience.kt b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/dto/GetExperience.kt similarity index 86% rename from Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/dto/DetailExperience.kt rename to Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/dto/GetExperience.kt index d6aff10e..38c65b01 100644 --- a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/dto/DetailExperience.kt +++ b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/dto/GetExperience.kt @@ -3,8 +3,12 @@ package com.bamyanggang.apimodule.domain.experience.application.dto import java.time.LocalDateTime import java.util.* -class DetailExperience { +class GetExperience { data class Response( + val experiences: List + ) + + data class DetailExperience( val id: UUID, val title: String, val parentTag: DetailTag, diff --git a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt index d2c0af1e..2b0559df 100644 --- a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt +++ b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceGetService.kt @@ -1,8 +1,8 @@ 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.experience.application.dto.GetExperience import com.bamyanggang.domainmodule.domain.experience.aggregate.Experience import com.bamyanggang.domainmodule.domain.experience.service.ExperienceReader import com.bamyanggang.domainmodule.domain.strongpoint.service.StrongPointReader @@ -16,7 +16,7 @@ class ExperienceGetService( private val strongPointReader: StrongPointReader, private val tagReader: TagReader, ) { - fun getExperienceDetailById(experienceId: UUID) : DetailExperience.Response { + fun getExperienceDetailById(experienceId: UUID) : GetExperience.DetailExperience { val oneExperience = experienceReader.readExperience(experienceId) return createExperienceDetailResponse(oneExperience) } @@ -28,25 +28,29 @@ class ExperienceGetService( .let { ExperienceYear.Response(it) } } - fun getExperienceByYearAndParentTag(year: Int, parentTagId: UUID): List { - return experienceReader.readByYearAndParentTagId(year, parentTagId).map { + fun getExperienceByYearAndParentTag(year: Int, parentTagId: UUID): GetExperience.Response { + val experiences = experienceReader.readByYearAndParentTagId(year, parentTagId).map { createExperienceDetailResponse(it) } + + return GetExperience.Response(experiences) } - fun getExperienceByYearAndChildTag(year: Int, childTagId: UUID): List { - return experienceReader.readByYearAndChildTagId(year, childTagId).map { + fun getExperienceByYearAndChildTag(year: Int, childTagId: UUID): GetExperience.Response { + val experiences = experienceReader.readByYearAndParentTagId(year, childTagId).map { createExperienceDetailResponse(it) } + + return GetExperience.Response(experiences) } - private fun createExperienceDetailResponse(experience: Experience): DetailExperience.Response { + private fun createExperienceDetailResponse(experience: Experience): GetExperience.DetailExperience { val detailExperienceContents = convertDetailExperienceContent(experience) val strongPointDetails = convertStrongPoints(experience) val detailParentTag = convertParentTag(experience) val detailChildTag = convertChildTag(experience) - return DetailExperience.Response( + return GetExperience.DetailExperience( id = experience.id, title = experience.title, parentTag = detailParentTag, @@ -60,7 +64,7 @@ class ExperienceGetService( private fun convertChildTag(oneExperience: Experience) = tagReader.readById(oneExperience.childTagId).let { - DetailExperience.DetailTag( + GetExperience.DetailTag( it.id, it.name ) @@ -68,14 +72,14 @@ class ExperienceGetService( private fun convertParentTag(oneExperience: Experience) = tagReader.readById(oneExperience.parentTagId).let { - DetailExperience.DetailTag( + GetExperience.DetailTag( it.id, it.name ) } private fun convertDetailExperienceContent(experience: Experience) = - experience.contents.map { DetailExperience.DetailExperienceContent( + experience.contents.map { GetExperience.DetailExperienceContent( it.question, it.answer ) @@ -84,7 +88,7 @@ class ExperienceGetService( private fun convertStrongPoints(experience: Experience) = experience.strongPoints.map { it.strongPointId }.let { strongPointReader.readByIds(it).map { strongPoint -> - DetailExperience.DetailStrongPoint( + GetExperience.DetailStrongPoint( strongPoint.id, strongPoint.name ) diff --git a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceController.kt b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceController.kt index d3147c1a..e412fb6c 100644 --- a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceController.kt +++ b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceController.kt @@ -1,9 +1,6 @@ package com.bamyanggang.apimodule.domain.experience.presentation -import com.bamyanggang.apimodule.domain.experience.application.dto.CreateExperience -import com.bamyanggang.apimodule.domain.experience.application.dto.DetailExperience -import com.bamyanggang.apimodule.domain.experience.application.dto.EditExperience -import com.bamyanggang.apimodule.domain.experience.application.dto.ExperienceYear +import com.bamyanggang.apimodule.domain.experience.application.dto.* import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceCreateService import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceDeleteService import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceEditService @@ -20,16 +17,16 @@ class ExperienceController( ) { @GetMapping(ExperienceApi.BASE_URL) fun getExperienceByFilter(@RequestParam("year") year: Int, - @RequestParam("parent-tag", required = false) parentTagId: UUID, + @RequestParam("parent-tag") parentTagId: UUID, @RequestParam("child-tag", required = false) childTagId: UUID? - ) : List = + ) : GetExperience.Response = when (childTagId){ null -> experienceGetService.getExperienceByYearAndParentTag(year, parentTagId) else -> experienceGetService.getExperienceByYearAndChildTag(year, childTagId) } @GetMapping(ExperienceApi.EXPERIENCE_PATH_VARIABLE_URL) - fun getExperience(@PathVariable("experienceId") experienceId: UUID): DetailExperience.Response { + fun getExperience(@PathVariable("experienceId") experienceId: UUID): GetExperience.DetailExperience { return experienceGetService.getExperienceDetailById(experienceId) } diff --git a/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt b/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt index be796b1e..0d66d9b5 100644 --- a/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt +++ b/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt @@ -2,9 +2,9 @@ package com.bamyanggang.apimodule.domain.experience.presentation import com.bamyanggang.apimodule.BaseRestDocsTest import com.bamyanggang.apimodule.domain.experience.application.dto.CreateExperience -import com.bamyanggang.apimodule.domain.experience.application.dto.DetailExperience import com.bamyanggang.apimodule.domain.experience.application.dto.EditExperience import com.bamyanggang.apimodule.domain.experience.application.dto.ExperienceYear +import com.bamyanggang.apimodule.domain.experience.application.dto.GetExperience import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceCreateService import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceDeleteService import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceEditService @@ -294,20 +294,20 @@ class ExperienceControllerTest : BaseRestDocsTest() { @Test @DisplayName("경험을 상세조회한다.") fun getExperienceDetailTest() { - val content1 = DetailExperience.DetailExperienceContent("질문1", "답변1") - val content2 = DetailExperience.DetailExperienceContent("질문2", "답변2") + val content1 = GetExperience.DetailExperienceContent("질문1", "답변1") + val content2 = GetExperience.DetailExperienceContent("질문2", "답변2") val contentResponse = arrayListOf(content1, content2) val experienceId: UUID = UUID.randomUUID() - val experienceDetailResponse : DetailExperience.Response = generateFixture { + val experienceDetailResponse : GetExperience.DetailExperience = generateFixture { it.set("id", experienceId) it.set("title", "제목") it.set("contents", contentResponse) - it.set("strongPoints", generateFixture>()) - it.set("parentTag", generateFixture()) - it.set("childTag", generateFixture()) + it.set("strongPoints", generateFixture>()) + it.set("parentTag", generateFixture()) + it.set("childTag", generateFixture()) it.set("startedAt", generateFixture()) it.set("endedAt", generateFixture()) } @@ -356,40 +356,43 @@ class ExperienceControllerTest : BaseRestDocsTest() { @Test @DisplayName("경험 목록을 상위 태그 id를 기준으로 조회한다.") fun getExperienceYearAndParentTagTest() { - val content1 = DetailExperience.DetailExperienceContent("질문1", "답변1") - val content2 = DetailExperience.DetailExperienceContent("질문2", "답변2") - val strongPoint1 = DetailExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 1") - val strongPoint2 = DetailExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 2") - val parentTag = DetailExperience.DetailTag(UUID.randomUUID(), "상위 태그 이름") - val childTag = DetailExperience.DetailTag(UUID.randomUUID(), "하위 태그 이름") + val content1 = GetExperience.DetailExperienceContent("질문1", "답변1") + val content2 = GetExperience.DetailExperienceContent("질문2", "답변2") + val strongPoint1 = GetExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 1") + val strongPoint2 = GetExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 2") + val parentTag = GetExperience.DetailTag(UUID.randomUUID(), "상위 태그 이름") + val childTag = GetExperience.DetailTag(UUID.randomUUID(), "하위 태그 이름") val startedAt = LocalDateTime.now() val endedAt = LocalDateTime.now().plusDays(1) val contentResponse = arrayListOf(content1, content2) val strongPointResponse = arrayListOf(strongPoint1, strongPoint2) - val experienceResponses = arrayListOf( - DetailExperience.Response( - id = UUID.randomUUID(), - title = "경험 제목1 ", - contents = contentResponse, - strongPoints = strongPointResponse, - parentTag = parentTag, - childTag = childTag, - startedAt = startedAt, - endedAt = endedAt - ), - DetailExperience.Response( - id = UUID.randomUUID(), - title = "경험 제목 2", - contents = contentResponse, - strongPoints = strongPointResponse, - parentTag = parentTag, - childTag = childTag, - startedAt = startedAt.minusYears(1), - endedAt = endedAt + val experienceResponses = + GetExperience.Response( + arrayListOf( + GetExperience.DetailExperience( + id = UUID.randomUUID(), + title = "경험 제목1 ", + contents = contentResponse, + strongPoints = strongPointResponse, + parentTag = parentTag, + childTag = childTag, + startedAt = startedAt, + endedAt = endedAt + ), + GetExperience.DetailExperience( + id = UUID.randomUUID(), + title = "경험 제목 2", + contents = contentResponse, + strongPoints = strongPointResponse, + parentTag = parentTag, + childTag = childTag, + startedAt = startedAt.minusYears(1), + endedAt = endedAt + ) + ) ) - ) val year = 2024 given(experienceGetService.getExperienceByYearAndParentTag(year, parentTag.id)).willReturn(experienceResponses) @@ -411,22 +414,22 @@ class ExperienceControllerTest : BaseRestDocsTest() { headerWithName("Authorization").description("엑세스 토큰") ), responseFields( - fieldWithPath("[].id").description("경험 id"), - fieldWithPath("[].title").description("경험 제목"), - fieldWithPath("[].contents").description("경험 내용"), - fieldWithPath("[].contents[].question").description("경험 내용 질문"), - fieldWithPath("[].contents[].answer").description("경험 내용 답변"), - fieldWithPath("[].strongPoints").description("관련된 역량 키워드"), - fieldWithPath("[].strongPoints[].id").description("역량 키워드 id"), - fieldWithPath("[].strongPoints[].name").description("역량 키워드 이름"), - fieldWithPath("[].parentTag").description("속한 상위 태그"), - fieldWithPath("[].parentTag.id").description("상위 태그 id"), - fieldWithPath("[].parentTag.name").description("상위 태그 이름"), - fieldWithPath("[].childTag").description("속한 하위 태그"), - fieldWithPath("[].childTag.id").description("하위 태그 id"), - fieldWithPath("[].childTag.name").description("하위 태그 이름"), - fieldWithPath("[].startedAt").description("경험 시작 날짜"), - fieldWithPath("[].endedAt").description("경험 종료 날짜"), + fieldWithPath("experiences[].id").description("경험 id"), + fieldWithPath("experiences[].title").description("경험 제목"), + fieldWithPath("experiences[].contents").description("경험 내용"), + fieldWithPath("experiences[].contents[].question").description("경험 내용 질문"), + fieldWithPath("experiences[].contents[].answer").description("경험 내용 답변"), + fieldWithPath("experiences[].strongPoints").description("관련된 역량 키워드"), + fieldWithPath("experiences[].strongPoints[].id").description("역량 키워드 id"), + fieldWithPath("experiences[].strongPoints[].name").description("역량 키워드 이름"), + fieldWithPath("experiences[].parentTag").description("속한 상위 태그"), + fieldWithPath("experiences[].parentTag.id").description("상위 태그 id"), + fieldWithPath("experiences[].parentTag.name").description("상위 태그 이름"), + fieldWithPath("experiences[].childTag").description("속한 하위 태그"), + fieldWithPath("experiences[].childTag.id").description("하위 태그 id"), + fieldWithPath("experiences[].childTag.name").description("하위 태그 이름"), + fieldWithPath("experiences[].startedAt").description("경험 시작 날짜"), + fieldWithPath("experiences[].endedAt").description("경험 종료 날짜"), ), ) ) @@ -435,40 +438,43 @@ class ExperienceControllerTest : BaseRestDocsTest() { @Test @DisplayName("경험 목록을 하위 태그 id를 기준으로 조회한다.") fun getExperienceYearAndChildTagTest() { - val content1 = DetailExperience.DetailExperienceContent("질문1", "답변1") - val content2 = DetailExperience.DetailExperienceContent("질문2", "답변2") - val strongPoint1 = DetailExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 1") - val strongPoint2 = DetailExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 2") - val parentTag = DetailExperience.DetailTag(UUID.randomUUID(), "상위 태그 이름") - val childTag = DetailExperience.DetailTag(UUID.randomUUID(), "하위 태그 이름") + val content1 = GetExperience.DetailExperienceContent("질문1", "답변1") + val content2 = GetExperience.DetailExperienceContent("질문2", "답변2") + val strongPoint1 = GetExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 1") + val strongPoint2 = GetExperience.DetailStrongPoint(UUID.randomUUID(), "역량 키워드 이름 2") + val parentTag = GetExperience.DetailTag(UUID.randomUUID(), "상위 태그 이름") + val childTag = GetExperience.DetailTag(UUID.randomUUID(), "하위 태그 이름") val startedAt = LocalDateTime.now() val endedAt = LocalDateTime.now().plusDays(1) val contentResponse = arrayListOf(content1, content2) val strongPointResponse = arrayListOf(strongPoint1, strongPoint2) - val experienceResponses = arrayListOf( - DetailExperience.Response( - id = UUID.randomUUID(), - title = "경험 제목1 ", - contents = contentResponse, - strongPoints = strongPointResponse, - parentTag = parentTag, - childTag = childTag, - startedAt = startedAt, - endedAt = endedAt - ), - DetailExperience.Response( - id = UUID.randomUUID(), - title = "경험 제목 2", - contents = contentResponse, - strongPoints = strongPointResponse, - parentTag = parentTag, - childTag = childTag, - startedAt = startedAt.minusYears(1), - endedAt = endedAt + val experienceResponses = + GetExperience.Response( + arrayListOf( + GetExperience.DetailExperience( + id = UUID.randomUUID(), + title = "경험 제목1 ", + contents = contentResponse, + strongPoints = strongPointResponse, + parentTag = parentTag, + childTag = childTag, + startedAt = startedAt, + endedAt = endedAt + ), + GetExperience.DetailExperience( + id = UUID.randomUUID(), + title = "경험 제목 2", + contents = contentResponse, + strongPoints = strongPointResponse, + parentTag = parentTag, + childTag = childTag, + startedAt = startedAt.minusYears(1), + endedAt = endedAt + ) + ) ) - ) val year = 2024 given(experienceGetService.getExperienceByYearAndChildTag(year, childTag.id)).willReturn(experienceResponses) @@ -490,23 +496,24 @@ class ExperienceControllerTest : BaseRestDocsTest() { headerWithName("Authorization").description("엑세스 토큰") ), responseFields( - fieldWithPath("[].id").description("경험 id"), - fieldWithPath("[].title").description("경험 제목"), - fieldWithPath("[].contents").description("경험 내용"), - fieldWithPath("[].contents[].question").description("경험 내용 질문"), - fieldWithPath("[].contents[].answer").description("경험 내용 답변"), - fieldWithPath("[].strongPoints").description("관련된 역량 키워드"), - fieldWithPath("[].strongPoints[].id").description("역량 키워드 id"), - fieldWithPath("[].strongPoints[].name").description("역량 키워드 이름"), - fieldWithPath("[].parentTag").description("속한 상위 태그"), - fieldWithPath("[].parentTag.id").description("상위 태그 id"), - fieldWithPath("[].parentTag.name").description("상위 태그 이름"), - fieldWithPath("[].childTag").description("속한 하위 태그"), - fieldWithPath("[].childTag.id").description("하위 태그 id"), - fieldWithPath("[].childTag.name").description("하위 태그 이름"), - fieldWithPath("[].startedAt").description("경험 시작 날짜"), - fieldWithPath("[].endedAt").description("경험 종료 날짜"), - ), + fieldWithPath("experiences").description("경험 목록"), + fieldWithPath("experiences[].id").description("경험 id"), + fieldWithPath("experiences[].title").description("경험 제목"), + fieldWithPath("experiences[].contents").description("경험 내용"), + fieldWithPath("experiences[].contents[].question").description("경험 내용 질문"), + fieldWithPath("experiences[].contents[].answer").description("경험 내용 답변"), + fieldWithPath("experiences[].strongPoints").description("관련된 역량 키워드"), + fieldWithPath("experiences[].strongPoints[].id").description("역량 키워드 id"), + fieldWithPath("experiences[].strongPoints[].name").description("역량 키워드 이름"), + fieldWithPath("experiences[].parentTag").description("속한 상위 태그"), + fieldWithPath("experiences[].parentTag.id").description("상위 태그 id"), + fieldWithPath("experiences[].parentTag.name").description("상위 태그 이름"), + fieldWithPath("experiences[].childTag").description("속한 하위 태그"), + fieldWithPath("experiences[].childTag.id").description("하위 태그 id"), + fieldWithPath("experiences[].childTag.name").description("하위 태그 이름"), + fieldWithPath("experiences[].startedAt").description("경험 시작 날짜"), + fieldWithPath("experiences[].endedAt").description("경험 종료 날짜"), + ) ) ) }