diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..0bcedcaf Binary files /dev/null and b/.DS_Store differ diff --git a/.deploy/Dockerfile b/.deploy/Dockerfile index 4823ec7c..52b8d891 100644 --- a/.deploy/Dockerfile +++ b/.deploy/Dockerfile @@ -7,4 +7,4 @@ ARG JAR_FILE=/Api-Module/build/libs/Api-Module-0.0.1-SNAPSHOT.jar COPY ${JAR_FILE} app.jar # 빌드된 이미지가 run될 때 실행할 명령어 -ENTRYPOINT ["java","-jar","app.jar"] \ No newline at end of file +ENTRYPOINT ["java","-jar","app.jar"] diff --git a/.deploy/docker-compose-dev.yml b/.deploy/docker-compose-dev.yml index dac13b5b..a0f97a53 100644 --- a/.deploy/docker-compose-dev.yml +++ b/.deploy/docker-compose-dev.yml @@ -13,4 +13,5 @@ services: - JWT_SECRET=${JWT_SECRET} - JWT_ACCESS_TOKEN_EXPIRATION_TIME=${JWT_ACCESS_TOKEN_EXPIRATION_TIME} - JWT_REFRESH_TOKEN_EXPIRATION_TIME=${JWT_REFRESH_TOKEN_EXPIRATION_TIME} - - JWT_REGISTRATION_TOKEN_EXPIRATION_TIME=${JWT_REGISTRATION_TOKEN_EXPIRATION_TIME} \ No newline at end of file + - JWT_REGISTRATION_TOKEN_EXPIRATION_TIME=${JWT_REGISTRATION_TOKEN_EXPIRATION_TIME} + - KEY_STORE_PASSWORD=${KEY_STORE_PASSWORD} diff --git a/.github/workflows/CD-dev.yml b/.github/workflows/CD-dev.yml index b08394fd..76fefdde 100644 --- a/.github/workflows/CD-dev.yml +++ b/.github/workflows/CD-dev.yml @@ -48,6 +48,7 @@ jobs: echo "JWT_ACCESS_TOKEN_EXPIRATION_TIME=${{ secrets.JWT_ACCESS_TOKEN_EXPIRATION_TIME }}" >> ./.env echo "JWT_REFRESH_TOKEN_EXPIRATION_TIME=${{ secrets.JWT_REFRESH_TOKEN_EXPIRATION_TIME }}" >> ./.env echo "JWT_REGISTRATION_TOKEN_EXPIRATION_TIME=${{ secrets.JWT_REGISTRATION_TOKEN_EXPIRATION_TIME }}" >> ./.env + echo "KEY_STORE_PASSWORD=${{ secrets.KEY_STORE_PASSWORD }}" >> ./.env # gradle build - name: Grant execute permission for gradlew 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 d56f7792..91bae41d 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,7 +40,7 @@ class ExperienceGetService( .distinctBy { it.parentTagId } .map { it.parentTagId } - val tagDetails = tagReader.readByParentTagIds(parentTagIds).map { + val tagDetails = tagReader.readByParentTagIdsAndYearAndExperienceCreatedAtDesc(parentTagIds, year).map { ExperienceYear.TagDetail( id = it.id, name = it.name @@ -111,7 +111,7 @@ class ExperienceGetService( val bookmarkExperienceIds = bookMarkReader.readByBookmarkStatusAndExperienceIds(experiencesIds, BookmarkStatus.ON) .map { it.experienceId } - println(bookmarkExperienceIds) + val bookmarkExperienceDetails = searchExperiences.map { when { it.id in bookmarkExperienceIds -> createBookmarkExperienceDetailResponse(it, BookmarkStatus.ON) @@ -249,7 +249,6 @@ class ExperienceGetService( private fun convertStrongPoints(strongPoints: List) : List { val strongPointIds = strongPoints.map { it.strongPointId } val defaultStrongPoints = keywordReader.readByIds(strongPointIds) - println(defaultStrongPoints) val targetStrongPointIds = strongPointIds.union(defaultStrongPoints.map { it.id }).toList() val customStrongPointDetails = strongPointReader.readByIds(targetStrongPointIds).map { strongPoint -> 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 cfd82737..43034e50 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 @@ -8,8 +8,6 @@ import com.bamyanggang.apimodule.domain.experience.application.service.Experienc import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceDeleteService import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceEditService import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceGetService -import com.bamyanggang.persistence.strongpoint.jpa.repository.KeywordJpaRepository -import com.bamyanggang.persistence.strongpoint.mapper.KeywordMapper import org.springframework.web.bind.annotation.* import java.util.* diff --git a/Api-Module/src/main/resources/application.yml b/Api-Module/src/main/resources/application.yml index f2f8f051..fe6d4728 100644 --- a/Api-Module/src/main/resources/application.yml +++ b/Api-Module/src/main/resources/application.yml @@ -1,8 +1,13 @@ server: shutdown: graceful + port: 8080 + ssl: + key-store: /ssl/keystore.p12 + key-store-type: PKCS12 + key-store-password: ${KEY_STORE_PASSWORD} spring: profiles: include: - db - - jwt \ No newline at end of file + - jwt diff --git a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/repository/TagRepository.kt b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/repository/TagRepository.kt index 52dd5efe..cc034130 100644 --- a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/repository/TagRepository.kt +++ b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/repository/TagRepository.kt @@ -13,4 +13,5 @@ interface TagRepository { fun findByParentTagIds(tagParentTagIds: List): List fun findByUserIdAndNameContains(userId: UUID, search: String): List fun findAllChildTagsByParentTagId(parentTagId: UUID) : List + fun findByParentTagIdsAndYearAndExperienceCreatedAtDesc(parentTagIds: List, year: Int): List } diff --git a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/service/TagReader.kt b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/service/TagReader.kt index a6d55756..62dddcd9 100644 --- a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/service/TagReader.kt +++ b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/service/TagReader.kt @@ -30,4 +30,8 @@ class TagReader( fun readChildTagsByParentTagId(parentTagId: UUID) : List { return tagRepository.findAllChildTagsByParentTagId(parentTagId) } + + fun readByParentTagIdsAndYearAndExperienceCreatedAtDesc(parentTagIds: List, year: Int): List { + return tagRepository.findByParentTagIdsAndYearAndExperienceCreatedAtDesc(parentTagIds, year) + } } diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/TagRepositoryImpl.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/TagRepositoryImpl.java index 4dcb7786..51b606df 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/TagRepositoryImpl.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/TagRepositoryImpl.java @@ -6,6 +6,7 @@ import com.bamyanggang.persistence.tag.jpa.entity.TagJpaEntity; import com.bamyanggang.persistence.tag.jpa.repository.TagJpaRepository; import com.bamyanggang.persistence.tag.mapper.TagMapper; +import java.time.LocalDateTime; import java.util.List; import java.util.UUID; import lombok.RequiredArgsConstructor; @@ -69,4 +70,15 @@ public List findAllChildTagsByParentTagId(UUID parentTagId) { return tagJpaEntities.stream().map(tagMapper::toDomainEntity).toList(); } + + @Override + public List findByParentTagIdsAndYearAndExperienceCreatedAtDesc(List parentTagIds, int year) { + LocalDateTime startYear = LocalDateTime.of(year, 1, 1, 0, 0); + LocalDateTime endYear = LocalDateTime.of(year, 12, 31, 23, 59); + + List tagJpaEntities = tagJpaRepository.findByParentTagIdAndYearAndExperienceCreatedAtDesc( + parentTagIds, startYear, endYear); + + return tagJpaEntities.stream().map(tagMapper::toDomainEntity).toList(); + } } diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/jpa/repository/TagJpaRepository.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/jpa/repository/TagJpaRepository.java index 553da93f..c502ad64 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/jpa/repository/TagJpaRepository.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/jpa/repository/TagJpaRepository.java @@ -1,13 +1,28 @@ package com.bamyanggang.persistence.tag.jpa.repository; import com.bamyanggang.persistence.tag.jpa.entity.TagJpaEntity; +import java.time.LocalDateTime; import java.util.List; import java.util.UUID; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; public interface TagJpaRepository extends JpaRepository { List findAllByUserIdAndParentTagIdIsNull(UUID userId); List findAllByUserIdAndParentTagId(UUID parentTagId, UUID parentId); List findByUserIdAndNameContaining(UUID userId, String name); List findAllByParentTagId(UUID parentTagId); + + @Query(""" + select t from TagJpaEntity t, ExperienceJpaEntity e + where e.parentTagId in :parentTagIds + and e.startedAt between :startYear and :endYear + and e.parentTagId = t.tagId + order by e.createdAt desc + """ + ) + List findByParentTagIdAndYearAndExperienceCreatedAtDesc(@Param("parentTagIds") List parentTagIds, + @Param("startYear") LocalDateTime startYear, + @Param("endYear") LocalDateTime endYear); } diff --git a/Support-Module/Jwt/.jqwik-database b/Support-Module/Jwt/.jqwik-database new file mode 100644 index 00000000..711006c3 Binary files /dev/null and b/Support-Module/Jwt/.jqwik-database differ diff --git a/Support-Module/cache/.jqwik-database b/Support-Module/cache/.jqwik-database new file mode 100644 index 00000000..711006c3 Binary files /dev/null and b/Support-Module/cache/.jqwik-database differ diff --git a/Support-Module/lock/.jqwik-database b/Support-Module/lock/.jqwik-database new file mode 100644 index 00000000..711006c3 Binary files /dev/null and b/Support-Module/lock/.jqwik-database differ