From 735bf606a97d0e05dd5988fe45fc8febd10ad2e4 Mon Sep 17 00:00:00 2001 From: Hanuel Lee <91522259+hanueleee@users.noreply.github.com> Date: Mon, 15 Jan 2024 11:34:30 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=EA=B9=83=ED=97=88=EB=B8=8C?= =?UTF-8?q?=EC=95=A1=EC=85=98=EC=9D=84=20=EC=9D=B4=EC=9A=A9=ED=95=9C=20CI/?= =?UTF-8?q?CD=20=EA=B5=AC=ED=98=84=20(#2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: cicd 테스트 * fix: Add known hosts 단계 추가 * fix: 디렉토리명 수정 * feat: gradle 캐싱 단계 추가 * fix: deploy.sh 파일 권한 설정 단계 추가 * fix: deploy.sh 파일 권한 설정 수정 * feat: submodule 관련 설정 추가 * feat: 디버깅용 단계 추가 * feat: main브랜치에 push시 작동하도록 수정 * feat: slack 알림 기능 추가 * fix: PR TEST파일 에러 처리 * fix: PR TEST파일 경로 설정 수정 --- .github/workflows/cicd-be.yml | 112 ++++++++++++++++++++++++++++++++++ .github/workflows/test-fe.yml | 76 ----------------------- .github/workflows/test.yml | 9 +-- 3 files changed, 114 insertions(+), 83 deletions(-) create mode 100644 .github/workflows/cicd-be.yml delete mode 100644 .github/workflows/test-fe.yml diff --git a/.github/workflows/cicd-be.yml b/.github/workflows/cicd-be.yml new file mode 100644 index 00000000..055b7176 --- /dev/null +++ b/.github/workflows/cicd-be.yml @@ -0,0 +1,112 @@ +name: Backend CI/CD + +on: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out Repository + uses: actions/checkout@v3 + with: + token: ${{ secrets.ACTION_TOKEN }} + submodules: true + + - name: Display first three lines of application.yml (debug) + run: head -n 3 src/main/resources/application.yml + + - name: Set up JDK11 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' + + - name: Gradle 캐싱 + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew clean build + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: cicdsample + path: build/libs/*.jar + + - name: Slack notification when build fail + if: failure() + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + author_name: [CI/CD] 백엔드 빌드 실패 + fields: repo, message, commit, author, action, eventName, ref, workflow, job, took + env: + SLACK_COLOR: '#FF2D00' + SLACK_USERNAME: 'Github Action' + SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_CICD }} + + deploy: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: cicdsample + + - name: Setup SSH + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Add known hosts + run: | + ssh-keyscan -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts + + - name: SCP transfer + run: scp *.jar ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }}:~/deploy + + - name: Execute remote shell script + run: | + ssh ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} "chmod +x ./deploy.sh" + ssh ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} "./deploy.sh" + + - name: Slack notification when deploy fail + if: failure() + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + author_name: [CI/CD] 백엔드 배포 실패 + fields: repo, message, commit, author, action, eventName, ref, workflow, job, took + env: + SLACK_COLOR: '#FF2D00' + SLACK_USERNAME: 'Github Action' + SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_CICD }} + + - name: Slack notification when deploy success + if: success() + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + author_name: [CI/CD] 백엔드 배포 성공 + fields: repo, message, commit, author, action, eventName, ref, workflow, job, took + env: + SLACK_COLOR: '#0019F4' + SLACK_USERNAME: 'Github Action' + SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_CICD }} diff --git a/.github/workflows/test-fe.yml b/.github/workflows/test-fe.yml deleted file mode 100644 index 4c2de232..00000000 --- a/.github/workflows/test-fe.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Frontend PR Test - -on: - pull_request: - branches: - - main - - develop - paths: - - '.github/**' - - 'frontend/**' - -jobs: - test: - runs-on: ubuntu-latest - timeout-minutes: 10 - - permissions: - checks: write - pull-requests: write - - steps: - - name: Repository 체크아웃 - uses: actions/checkout@v3 - - - name: Node 설정 - uses: actions/setup-node@v3 - with: - node-version: '18.16.1' - - - name: node_modules 캐싱 - id: cache - uses: actions/cache@v3 - with: - path: '**/frontend/node_modules' - key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: 의존성 설치 - working-directory: frontend/ - if: steps.cache.outputs.cache-hit != 'true' - run: yarn install --pure-lockfile - - - name: 테스트 실행 - working-directory: frontend/ - run: yarn test - continue-on-error: true - - - name: 테스트 결과 PR에 코멘트 등록 - uses: EnricoMi/publish-unit-test-result-action@v2 - if: always() - with: - files: '**/frontend/test-results/results.xml' - - - name: 테스트 실패 시, 실패한 코드 라인에 Check 코멘트를 등록 - uses: mikepenz/action-junit-report@v3 - if: always() - with: - report_paths: '**/frontend/test-results/results.xml' - token: ${{ github.token }} - - - name: build 실패 시 Slack으로 알립니다 - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - author_name: 프론트엔드 테스트 실패 알림 - fields: repo, message, commit, author, action, eventName, ref, workflow, job, took - env: - SLACK_CHANNEL: group-dev - SLACK_COLOR: '#FF2D00' - SLACK_USERNAME: 'Github Action' - SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png - SLACK_TITLE: Build Failure - ${{ github.event.pull_request.title }} - SLACK_MESSAGE: PR Url - ${{ github.event.pull_request.url }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: failure() diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 160ab01e..5ab390eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,9 +5,6 @@ on: branches: - main - develop - paths: - - '.github/**' - - 'backend/**' jobs: test: @@ -39,11 +36,9 @@ jobs: ${{ runner.os }}-gradle- - name: Gradle 권한 부여 - working-directory: backend/ - run: chmod +x ./gradlew + run: chmod +x gradlew - name: 테스트 실행 - working-directory: backend/ run: ./gradlew --info test - name: 테스트 결과 PR에 코멘트 등록 @@ -72,5 +67,5 @@ jobs: SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png SLACK_TITLE: Build Failure - ${{ github.event.pull_request.title }} SLACK_MESSAGE: PR Url - ${{ github.event.pull_request.url }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_PR_TEST }} if: failure() From 48dd95cc6f25833df07e9182b41552bcf212176a Mon Sep 17 00:00:00 2001 From: JFe <33208246+Go-Jaecheol@users.noreply.github.com> Date: Mon, 15 Jan 2024 11:35:06 +0900 Subject: [PATCH 2/5] =?UTF-8?q?refactor:=20=EC=83=81=ED=92=88=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=20=EC=99=84=EC=84=B1=20API=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=95=20=EB=B0=A9=EC=8B=9D=20=EB=B3=80=EA=B2=BD=20(#4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 상품 자동 완성 API 커서 기반 페이징으로 변경 * test: 상품 자동 완성 repository 테스트 추가 * test: 상품 자동 완성 인수 테스트 수정 --- .../product/application/ProductService.java | 16 +++++++--- .../product/dto/SearchProductsResponse.java | 15 +++++---- .../persistence/ProductRepository.java | 11 ++++++- .../presentation/ProductApiController.java | 5 ++- .../presentation/ProductController.java | 2 +- .../product/ProductAcceptanceTest.java | 30 ++++++------------ .../acceptance/product/ProductSteps.java | 5 ++- .../persistence/ProductRepositoryTest.java | 31 +++++++++++++++++-- 8 files changed, 71 insertions(+), 44 deletions(-) diff --git a/src/main/java/com/funeat/product/application/ProductService.java b/src/main/java/com/funeat/product/application/ProductService.java index 021ffe12..058ab02e 100644 --- a/src/main/java/com/funeat/product/application/ProductService.java +++ b/src/main/java/com/funeat/product/application/ProductService.java @@ -135,15 +135,23 @@ public RankingProductsResponse getTop3Products() { return RankingProductsResponse.toResponse(rankingProductDtos); } - public SearchProductsResponse searchProducts(final String query, final Pageable pageable) { - final Page products = productRepository.findAllByNameContaining(query, pageable); + public SearchProductsResponse searchProducts(final String query, final Long lastProductId) { + final List products = findAllByNameContaining(query, lastProductId); - final PageDto pageDto = PageDto.toDto(products); + final boolean hasNext = products.size() > DEFAULT_PAGE_SIZE; final List productDtos = products.stream() .map(SearchProductDto::toDto) .collect(Collectors.toList()); - return SearchProductsResponse.toResponse(pageDto, productDtos); + return SearchProductsResponse.toResponse(hasNext, productDtos); + } + + private List findAllByNameContaining(final String query, final Long lastProductId) { + final PageRequest size = PageRequest.ofSize(DEFAULT_PAGE_SIZE); + if (lastProductId == 0) { + return productRepository.findAllByNameContainingFirst(query, size); + } + return productRepository.findAllByNameContaining(query, lastProductId, size); } public SearchProductResultsResponse getSearchResults(final String query, final Pageable pageable) { diff --git a/src/main/java/com/funeat/product/dto/SearchProductsResponse.java b/src/main/java/com/funeat/product/dto/SearchProductsResponse.java index ccdeade5..098c8e50 100644 --- a/src/main/java/com/funeat/product/dto/SearchProductsResponse.java +++ b/src/main/java/com/funeat/product/dto/SearchProductsResponse.java @@ -1,24 +1,23 @@ package com.funeat.product.dto; -import com.funeat.common.dto.PageDto; import java.util.List; public class SearchProductsResponse { - private final PageDto page; + private final boolean hasNext; private final List products; - public SearchProductsResponse(final PageDto page, final List products) { - this.page = page; + private SearchProductsResponse(final boolean hasNext, final List products) { + this.hasNext = hasNext; this.products = products; } - public static SearchProductsResponse toResponse(final PageDto page, final List products) { - return new SearchProductsResponse(page, products); + public static SearchProductsResponse toResponse(final boolean hasNext, final List products) { + return new SearchProductsResponse(hasNext, products); } - public PageDto getPage() { - return page; + public boolean isHasNext() { + return hasNext; } public List getProducts() { diff --git a/src/main/java/com/funeat/product/persistence/ProductRepository.java b/src/main/java/com/funeat/product/persistence/ProductRepository.java index 27208f25..8d07bc49 100644 --- a/src/main/java/com/funeat/product/persistence/ProductRepository.java +++ b/src/main/java/com/funeat/product/persistence/ProductRepository.java @@ -26,7 +26,16 @@ List findAllByAverageRatingGreaterThan3(final LocalDateTi + "ORDER BY " + "(CASE WHEN p.name LIKE CONCAT(:name, '%') THEN 1 ELSE 2 END), " + "p.id DESC") - Page findAllByNameContaining(@Param("name") final String name, final Pageable pageable); + List findAllByNameContainingFirst(@Param("name") final String name, final Pageable pageable); + + @Query("SELECT p FROM Product p " + + "JOIN Product last ON last.id = :lastId " + + "WHERE p.name LIKE CONCAT('%', :name, '%') " + + "AND (last.name LIKE CONCAT(:name, '%') " + + "AND ((p.name LIKE CONCAT(:name, '%') AND p.id < :lastId) OR (p.name NOT LIKE CONCAT(:name, '%'))) " + + "OR (p.name NOT LIKE CONCAT(:name, '%') AND p.id < :lastId)) " + + "ORDER BY (CASE WHEN p.name LIKE CONCAT(:name, '%') THEN 1 ELSE 2 END), p.id DESC") + List findAllByNameContaining(@Param("name") final String name, final Long lastId, final Pageable pageable); @Query("SELECT new com.funeat.product.dto.ProductReviewCountDto(p, COUNT(r.id)) FROM Product p " + "LEFT JOIN Review r ON r.product.id = p.id " diff --git a/src/main/java/com/funeat/product/presentation/ProductApiController.java b/src/main/java/com/funeat/product/presentation/ProductApiController.java index 46435aee..5a85de8d 100644 --- a/src/main/java/com/funeat/product/presentation/ProductApiController.java +++ b/src/main/java/com/funeat/product/presentation/ProductApiController.java @@ -51,9 +51,8 @@ public ResponseEntity getRankingProducts() { @GetMapping("/search/products") public ResponseEntity searchProducts(@RequestParam final String query, - @PageableDefault final Pageable pageable) { - final PageRequest pageRequest = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize()); - final SearchProductsResponse response = productService.searchProducts(query, pageRequest); + @RequestParam final Long lastProductId) { + final SearchProductsResponse response = productService.searchProducts(query, lastProductId); return ResponseEntity.ok(response); } diff --git a/src/main/java/com/funeat/product/presentation/ProductController.java b/src/main/java/com/funeat/product/presentation/ProductController.java index 3fa704eb..848cf005 100644 --- a/src/main/java/com/funeat/product/presentation/ProductController.java +++ b/src/main/java/com/funeat/product/presentation/ProductController.java @@ -54,7 +54,7 @@ ResponseEntity getAllProductsInCategory( ) @GetMapping ResponseEntity searchProducts(@RequestParam final String query, - @PageableDefault final Pageable pageable); + @RequestParam final Long lastProductId); @Operation(summary = "상품 검색 결과 조회", description = "문자열을 받아 상품을 검색하고 검색 결과들을 조회한다.") @ApiResponse( diff --git a/src/test/java/com/funeat/acceptance/product/ProductAcceptanceTest.java b/src/test/java/com/funeat/acceptance/product/ProductAcceptanceTest.java index 5a73e655..6545f52d 100644 --- a/src/test/java/com/funeat/acceptance/product/ProductAcceptanceTest.java +++ b/src/test/java/com/funeat/acceptance/product/ProductAcceptanceTest.java @@ -98,6 +98,7 @@ import com.funeat.product.dto.RankingProductDto; import com.funeat.product.dto.SearchProductDto; import com.funeat.product.dto.SearchProductResultDto; +import com.funeat.product.dto.SearchProductsResponse; import com.funeat.recipe.dto.RecipeDto; import com.funeat.tag.dto.TagDto; import io.restassured.response.ExtractableResponse; @@ -414,14 +415,11 @@ class searchProducts_성공_테스트 { final var 상품1 = 단일_상품_저장(상품_애플망고_가격3000원_평점5점_생성(카테고리)); final var 상품2 = 단일_상품_저장(상품_망고빙수_가격5000원_평점4점_생성(카테고리)); - final var 예상_응답_페이지 = 응답_페이지_생성(총_데이터_개수(2L), 총_페이지(1L), 첫페이지O, 마지막페이지O, FIRST_PAGE, PAGE_SIZE); - // when - final var 응답 = 상품_자동_완성_검색_요청("망고", FIRST_PAGE); + final var 응답 = 상품_자동_완성_검색_요청("망고", 0L); // then STATUS_CODE를_검증한다(응답, 정상_처리); - 페이지를_검증한다(응답, 예상_응답_페이지); 상품_자동_완성_검색_결과를_검증한다(응답, List.of(상품2, 상품1)); } @@ -432,14 +430,11 @@ class searchProducts_성공_테스트 { 단일_카테고리_저장(카테고리); 반복_애플망고_상품_저장(2, 카테고리); - final var 예상_응답_페이지 = 응답_페이지_생성(총_데이터_개수(0L), 총_페이지(0L), 첫페이지O, 마지막페이지O, FIRST_PAGE, PAGE_SIZE); - // when - final var 응답 = 상품_자동_완성_검색_요청("김밥", FIRST_PAGE); + final var 응답 = 상품_자동_완성_검색_요청("김밥", 0L); // then STATUS_CODE를_검증한다(응답, 정상_처리); - 페이지를_검증한다(응답, 예상_응답_페이지); 상품_자동_완성_검색_결과를_검증한다(응답, Collections.emptyList()); } @@ -449,21 +444,17 @@ class searchProducts_성공_테스트 { final var 카테고리 = 카테고리_간편식사_생성(); 단일_카테고리_저장(카테고리); 단일_상품_저장(상품_망고빙수_가격5000원_평점4점_생성(카테고리)); - 반복_애플망고_상품_저장(10, 카테고리); - - final var 예상_응답_페이지1 = 응답_페이지_생성(총_데이터_개수(11L), 총_페이지(2L), 첫페이지O, 마지막페이지X, FIRST_PAGE, PAGE_SIZE); - final var 예상_응답_페이지2 = 응답_페이지_생성(총_데이터_개수(11L), 총_페이지(2L), 첫페이지X, 마지막페이지O, SECOND_PAGE, PAGE_SIZE); + 반복_애플망고_상품_저장(15, 카테고리); // when - final var 응답1 = 상품_자동_완성_검색_요청("망고", FIRST_PAGE); - final var 응답2 = 상품_자동_완성_검색_요청("망고", SECOND_PAGE); + final var 응답1 = 상품_자동_완성_검색_요청("망고", 0L); + final var result = 응답1.as(SearchProductsResponse.class).getProducts(); + final var lastId = result.get(result.size() - 1).getId(); + final var 응답2 = 상품_자동_완성_검색_요청("망고", lastId); // then STATUS_CODE를_검증한다(응답1, 정상_처리); - 페이지를_검증한다(응답1, 예상_응답_페이지1); - STATUS_CODE를_검증한다(응답2, 정상_처리); - 페이지를_검증한다(응답2, 예상_응답_페이지2); 결과값이_이전_요청_결과값에_중복되는지_검증(응답1, 응답2); } @@ -477,14 +468,11 @@ class searchProducts_성공_테스트 { 반복_애플망고_상품_저장(9, 카테고리); 단일_상품_저장(상품_망고빙수_가격5000원_평점4점_생성(카테고리)); - final var 예상_응답_페이지 = 응답_페이지_생성(총_데이터_개수(11L), 총_페이지(2L), 첫페이지O, 마지막페이지X, FIRST_PAGE, PAGE_SIZE); - // when - final var 응답 = 상품_자동_완성_검색_요청("망고", FIRST_PAGE); + final var 응답 = 상품_자동_완성_검색_요청("망고", 0L); // then STATUS_CODE를_검증한다(응답, 정상_처리); - 페이지를_검증한다(응답, 예상_응답_페이지); 상품_자동_완성_검색_결과를_검증한다(응답, List.of(상품11, 상품1, 상품10, 상품9, 상품8, 상품7, 상품6, 상품5, 상품4, 상품3)); } } diff --git a/src/test/java/com/funeat/acceptance/product/ProductSteps.java b/src/test/java/com/funeat/acceptance/product/ProductSteps.java index d41bd5be..df872481 100644 --- a/src/test/java/com/funeat/acceptance/product/ProductSteps.java +++ b/src/test/java/com/funeat/acceptance/product/ProductSteps.java @@ -2,7 +2,6 @@ import static io.restassured.RestAssured.given; - import io.restassured.response.ExtractableResponse; import io.restassured.response.Response; @@ -36,10 +35,10 @@ public class ProductSteps { .extract(); } - public static ExtractableResponse 상품_자동_완성_검색_요청(final String query, final Long page) { + public static ExtractableResponse 상품_자동_완성_검색_요청(final String query, final Long lastProductId) { return given() .queryParam("query", query) - .queryParam("page", page) + .queryParam("lastProductId", lastProductId) .when() .get("/api/search/products") .then() diff --git a/src/test/java/com/funeat/product/persistence/ProductRepositoryTest.java b/src/test/java/com/funeat/product/persistence/ProductRepositoryTest.java index 10758547..a93c15f5 100644 --- a/src/test/java/com/funeat/product/persistence/ProductRepositoryTest.java +++ b/src/test/java/com/funeat/product/persistence/ProductRepositoryTest.java @@ -24,6 +24,7 @@ import java.util.List; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; +import org.springframework.data.domain.PageRequest; @SuppressWarnings("NonAsciiCharacters") class ProductRepositoryTest extends RepositoryTest { @@ -102,7 +103,7 @@ class findAllByAverageRatingGreaterThan3_성공_테스트 { } @Nested - class findAllByNameContaining_성공_테스트 { + class findAllByNameContainingFirst_성공_테스트 { @Test void 상품명에_검색어가_포함된_상품들을_조회한다() { @@ -114,12 +115,36 @@ class findAllByNameContaining_성공_테스트 { final var product2 = 상품_망고빙수_가격5000원_평점4점_생성(category); 복수_상품_저장(product1, product2); - final var page = 페이지요청_기본_생성(0, 10); + final var expected = List.of(product2, product1); + + // when + final var actual = productRepository.findAllByNameContainingFirst("망고", PageRequest.of(0, 2)); + + // then + assertThat(actual).usingRecursiveComparison() + .isEqualTo(expected); + } + } + + @Nested + class findAllByNameContaining_성공_테스트 { + + @Test + void 상품명에_검색어가_포함된_상품들을_조회한다() { + // given + final var category = 카테고리_간편식사_생성(); + 단일_카테고리_저장(category); + + final var product1 = 상품_애플망고_가격3000원_평점5점_생성(category); + final var product2 = 상품_망고빙수_가격5000원_평점4점_생성(category); + final var product3 = 상품_망고빙수_가격5000원_평점4점_생성(category); + final var product4 = 상품_망고빙수_가격5000원_평점4점_생성(category); + 복수_상품_저장(product1, product2, product3, product4); final var expected = List.of(product2, product1); // when - final var actual = productRepository.findAllByNameContaining("망고", page).getContent(); + final var actual = productRepository.findAllByNameContaining("망고", 3L, PageRequest.of(0, 4)); // then assertThat(actual).usingRecursiveComparison() From 969beb5507faef6cf5126aeb361fb75c4caf4c12 Mon Sep 17 00:00:00 2001 From: wugawuga Date: Mon, 15 Jan 2024 11:41:58 +0900 Subject: [PATCH 3/5] =?UTF-8?q?chore:=20=EC=84=9C=EB=B8=8C=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=B5=9C=EC=8B=A0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources b/src/main/resources index e0b7ca27..c97d4c0b 160000 --- a/src/main/resources +++ b/src/main/resources @@ -1 +1 @@ -Subproject commit e0b7ca2710c542b367db5e75c5b9e55990cc8800 +Subproject commit c97d4c0be65d1afe5d9c3bb501c105f3c2c6854b From 9a1520ccf2c639a80afe278a2812c65b9e7e9f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9A=B0=EA=B0=80?= Date: Mon, 15 Jan 2024 12:24:33 +0900 Subject: [PATCH 4/5] =?UTF-8?q?chore:=202.7.1=20->=203.2.1=20springboot=20?= =?UTF-8?q?=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4=EC=85=98=20(#8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 2.7.1 -> 3.2.1 springboot 마이그레이션 * refactor: 리뷰 반영 * chore: ci-cd jdk 버전 21로 업데이트 * chore: test.yml jdk 버전 21로 업데이트 --- .github/workflows/cicd-be.yml | 6 ++--- .github/workflows/test.yml | 6 ++--- build.gradle | 8 +++---- gradle/wrapper/gradle-wrapper.properties | 3 ++- .../presentation/AdminLoginController.java | 2 +- .../AdminProductSpecification.java | 4 ++-- .../AdminReviewSpecification.java | 4 ++-- .../admin/util/AdminCheckInterceptor.java | 6 ++--- .../funeat/auth/application/AuthService.java | 2 +- .../auth/presentation/AuthApiController.java | 6 ++--- .../auth/presentation/AuthController.java | 4 ++-- .../auth/util/AuthArgumentResolver.java | 4 ++-- .../auth/util/AuthHandlerInterceptor.java | 6 ++--- .../java/com/funeat/banner/domain/Banner.java | 8 +++---- .../com/funeat/comment/domain/Comment.java | 16 +++++++------- .../specification/CommentSpecification.java | 4 ++-- .../funeat/common/logging/LoggingAspect.java | 2 +- .../common/repository/BaseRepositoryImpl.java | 4 ++-- .../presentation/GlobalControllerAdvice.java | 2 +- .../java/com/funeat/member/domain/Member.java | 10 ++++----- .../domain/favorite/RecipeFavorite.java | 18 +++++++-------- .../domain/favorite/ReviewFavorite.java | 18 +++++++-------- .../com/funeat/member/dto/MemberRequest.java | 2 +- .../presentation/MemberApiController.java | 2 +- .../com/funeat/product/domain/Category.java | 12 +++++----- .../com/funeat/product/domain/Product.java | 16 +++++++------- .../funeat/product/domain/ProductRecipe.java | 14 ++++++------ .../persistence/ProductSpecification.java | 8 +++---- .../java/com/funeat/recipe/domain/Recipe.java | 16 +++++++------- .../com/funeat/recipe/domain/RecipeImage.java | 14 ++++++------ .../dto/RecipeCommentCreateRequest.java | 4 ++-- .../recipe/dto/RecipeCreateRequest.java | 6 ++--- .../recipe/dto/RecipeFavoriteRequest.java | 2 +- .../recipe/persistence/RecipeRepository.java | 2 +- .../presentation/RecipeApiController.java | 2 +- .../util/RecipeDetailHandlerInterceptor.java | 6 ++--- .../recipe/util/RecipeHandlerInterceptor.java | 6 ++--- .../java/com/funeat/review/domain/Review.java | 18 +++++++-------- .../com/funeat/review/domain/ReviewTag.java | 14 ++++++------ .../review/dto/ReviewCreateRequest.java | 6 ++--- .../review/dto/ReviewFavoriteRequest.java | 2 +- .../review/dto/SortingReviewRequest.java | 4 ++-- .../review/persistence/ReviewRepository.java | 2 +- .../persistence/ReviewRepositoryImpl.java | 22 +++++++++---------- .../presentation/ReviewApiController.java | 2 +- .../SortingReviewSpecification.java | 8 +++---- src/main/java/com/funeat/tag/domain/Tag.java | 12 +++++----- .../funeat/acceptance/auth/LoginSteps.java | 4 ++++ .../funeat/acceptance/review/ReviewSteps.java | 4 ++++ .../java/com/funeat/common/DataCleaner.java | 16 +++++++++----- src/test/resources/application.yml | 8 +++---- 51 files changed, 194 insertions(+), 183 deletions(-) diff --git a/.github/workflows/cicd-be.yml b/.github/workflows/cicd-be.yml index 055b7176..362c33fc 100644 --- a/.github/workflows/cicd-be.yml +++ b/.github/workflows/cicd-be.yml @@ -17,11 +17,11 @@ jobs: - name: Display first three lines of application.yml (debug) run: head -n 3 src/main/resources/application.yml - - name: Set up JDK11 + - name: Set up JDK21 uses: actions/setup-java@v3 with: - distribution: 'temurin' - java-version: '11' + distribution: 'corretto' + java-version: '21' - name: Gradle 캐싱 uses: actions/cache@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ab390eb..bd060e54 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,11 +19,11 @@ jobs: - name: Repository 체크아웃 uses: actions/checkout@v3 - - name: JDK 11 설정 + - name: JDK 21 설정 uses: actions/setup-java@v3 with: - java-version: 11 - distribution: temurin + java-version: 21 + distribution: corretto - name: Gradle 캐싱 uses: actions/cache@v3 diff --git a/build.gradle b/build.gradle index 3d46c806..ab29b57f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ plugins { id 'java' - id 'org.springframework.boot' version '2.7.13' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'org.springframework.boot' version '3.2.1' + id 'io.spring.dependency-management' version '1.1.4' } group = 'com.funeat' version = '0.0.1-SNAPSHOT' java { - sourceCompatibility = '11' + sourceCompatibility = '21' } repositories { @@ -21,7 +21,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' runtimeOnly 'com.mysql:mysql-connector-j' testImplementation 'org.springframework.boot:spring-boot-starter-test' - testImplementation 'io.rest-assured:rest-assured:4.4.0' + testImplementation 'io.rest-assured:rest-assured:5.3.2' testRuntimeOnly 'com.h2database:h2' implementation 'org.springdoc:springdoc-openapi-ui:1.7.0' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d3..083242f2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 +#validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/com/funeat/admin/presentation/AdminLoginController.java b/src/main/java/com/funeat/admin/presentation/AdminLoginController.java index d23125a8..97d314a3 100644 --- a/src/main/java/com/funeat/admin/presentation/AdminLoginController.java +++ b/src/main/java/com/funeat/admin/presentation/AdminLoginController.java @@ -2,7 +2,7 @@ import com.funeat.admin.application.AdminChecker; import com.funeat.admin.domain.AdminAuthInfo; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; diff --git a/src/main/java/com/funeat/admin/specification/AdminProductSpecification.java b/src/main/java/com/funeat/admin/specification/AdminProductSpecification.java index c48ea030..c4fad7b9 100644 --- a/src/main/java/com/funeat/admin/specification/AdminProductSpecification.java +++ b/src/main/java/com/funeat/admin/specification/AdminProductSpecification.java @@ -5,8 +5,8 @@ import com.funeat.product.domain.Product; import java.util.List; import java.util.Objects; -import javax.persistence.criteria.JoinType; -import javax.persistence.criteria.Path; +import jakarta.persistence.criteria.JoinType; +import jakarta.persistence.criteria.Path; import org.springframework.data.jpa.domain.Specification; public class AdminProductSpecification { diff --git a/src/main/java/com/funeat/admin/specification/AdminReviewSpecification.java b/src/main/java/com/funeat/admin/specification/AdminReviewSpecification.java index 045147de..c4ea1e6d 100644 --- a/src/main/java/com/funeat/admin/specification/AdminReviewSpecification.java +++ b/src/main/java/com/funeat/admin/specification/AdminReviewSpecification.java @@ -5,8 +5,8 @@ import com.funeat.review.domain.Review; import java.time.LocalDateTime; import java.util.Objects; -import javax.persistence.criteria.JoinType; -import javax.persistence.criteria.Path; +import jakarta.persistence.criteria.JoinType; +import jakarta.persistence.criteria.Path; import org.springframework.data.jpa.domain.Specification; public class AdminReviewSpecification { diff --git a/src/main/java/com/funeat/admin/util/AdminCheckInterceptor.java b/src/main/java/com/funeat/admin/util/AdminCheckInterceptor.java index 59ef45b4..cb7e26ce 100644 --- a/src/main/java/com/funeat/admin/util/AdminCheckInterceptor.java +++ b/src/main/java/com/funeat/admin/util/AdminCheckInterceptor.java @@ -6,9 +6,9 @@ import com.funeat.admin.domain.AdminAuthInfo; import com.funeat.auth.exception.AuthException.NotLoggedInException; import java.util.Objects; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; diff --git a/src/main/java/com/funeat/auth/application/AuthService.java b/src/main/java/com/funeat/auth/application/AuthService.java index 20a24345..d7cf71ab 100644 --- a/src/main/java/com/funeat/auth/application/AuthService.java +++ b/src/main/java/com/funeat/auth/application/AuthService.java @@ -4,7 +4,7 @@ import com.funeat.auth.dto.UserInfoDto; import com.funeat.auth.util.PlatformUserProvider; import com.funeat.member.application.MemberService; -import javax.servlet.http.Cookie; +import jakarta.servlet.http.Cookie; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/com/funeat/auth/presentation/AuthApiController.java b/src/main/java/com/funeat/auth/presentation/AuthApiController.java index f7931460..5a81b375 100644 --- a/src/main/java/com/funeat/auth/presentation/AuthApiController.java +++ b/src/main/java/com/funeat/auth/presentation/AuthApiController.java @@ -5,9 +5,9 @@ import com.funeat.auth.dto.SignUserDto; import com.funeat.auth.util.AuthenticationPrincipal; import java.net.URI; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; diff --git a/src/main/java/com/funeat/auth/presentation/AuthController.java b/src/main/java/com/funeat/auth/presentation/AuthController.java index db05a7f8..f547385d 100644 --- a/src/main/java/com/funeat/auth/presentation/AuthController.java +++ b/src/main/java/com/funeat/auth/presentation/AuthController.java @@ -5,8 +5,8 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; diff --git a/src/main/java/com/funeat/auth/util/AuthArgumentResolver.java b/src/main/java/com/funeat/auth/util/AuthArgumentResolver.java index e5a3e0e9..cd181eca 100644 --- a/src/main/java/com/funeat/auth/util/AuthArgumentResolver.java +++ b/src/main/java/com/funeat/auth/util/AuthArgumentResolver.java @@ -2,8 +2,8 @@ import com.funeat.auth.dto.LoginInfo; import java.util.Objects; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; import org.springframework.core.MethodParameter; import org.springframework.stereotype.Component; import org.springframework.web.bind.support.WebDataBinderFactory; diff --git a/src/main/java/com/funeat/auth/util/AuthHandlerInterceptor.java b/src/main/java/com/funeat/auth/util/AuthHandlerInterceptor.java index 48339aee..0653e2fa 100644 --- a/src/main/java/com/funeat/auth/util/AuthHandlerInterceptor.java +++ b/src/main/java/com/funeat/auth/util/AuthHandlerInterceptor.java @@ -3,9 +3,9 @@ import com.funeat.auth.exception.AuthErrorCode; import com.funeat.auth.exception.AuthException.NotLoggedInException; import java.util.Objects; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; diff --git a/src/main/java/com/funeat/banner/domain/Banner.java b/src/main/java/com/funeat/banner/domain/Banner.java index 9ea8eabd..6e526608 100644 --- a/src/main/java/com/funeat/banner/domain/Banner.java +++ b/src/main/java/com/funeat/banner/domain/Banner.java @@ -1,9 +1,9 @@ package com.funeat.banner.domain; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; @Entity public class Banner { diff --git a/src/main/java/com/funeat/comment/domain/Comment.java b/src/main/java/com/funeat/comment/domain/Comment.java index 4e6798b9..ece249df 100644 --- a/src/main/java/com/funeat/comment/domain/Comment.java +++ b/src/main/java/com/funeat/comment/domain/Comment.java @@ -3,14 +3,14 @@ import com.funeat.member.domain.Member; import com.funeat.recipe.domain.Recipe; import java.time.LocalDateTime; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; @Entity public class Comment { diff --git a/src/main/java/com/funeat/comment/specification/CommentSpecification.java b/src/main/java/com/funeat/comment/specification/CommentSpecification.java index db6c734b..a302eca2 100644 --- a/src/main/java/com/funeat/comment/specification/CommentSpecification.java +++ b/src/main/java/com/funeat/comment/specification/CommentSpecification.java @@ -4,8 +4,8 @@ import com.funeat.recipe.domain.Recipe; import java.util.List; import java.util.Objects; -import javax.persistence.criteria.JoinType; -import javax.persistence.criteria.Path; +import jakarta.persistence.criteria.JoinType; +import jakarta.persistence.criteria.Path; import org.springframework.data.jpa.domain.Specification; public class CommentSpecification { diff --git a/src/main/java/com/funeat/common/logging/LoggingAspect.java b/src/main/java/com/funeat/common/logging/LoggingAspect.java index 13758c6c..be61ac8f 100644 --- a/src/main/java/com/funeat/common/logging/LoggingAspect.java +++ b/src/main/java/com/funeat/common/logging/LoggingAspect.java @@ -7,7 +7,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; diff --git a/src/main/java/com/funeat/common/repository/BaseRepositoryImpl.java b/src/main/java/com/funeat/common/repository/BaseRepositoryImpl.java index 64cd508f..6ec0cc12 100644 --- a/src/main/java/com/funeat/common/repository/BaseRepositoryImpl.java +++ b/src/main/java/com/funeat/common/repository/BaseRepositoryImpl.java @@ -2,8 +2,8 @@ import java.io.Serializable; import java.util.List; -import javax.persistence.EntityManager; -import javax.persistence.TypedQuery; +import jakarta.persistence.EntityManager; +import jakarta.persistence.TypedQuery; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; diff --git a/src/main/java/com/funeat/exception/presentation/GlobalControllerAdvice.java b/src/main/java/com/funeat/exception/presentation/GlobalControllerAdvice.java index b6fed678..f98419ee 100644 --- a/src/main/java/com/funeat/exception/presentation/GlobalControllerAdvice.java +++ b/src/main/java/com/funeat/exception/presentation/GlobalControllerAdvice.java @@ -8,7 +8,7 @@ import com.funeat.exception.ErrorCode; import com.funeat.exception.GlobalException; import java.util.stream.Collectors; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.support.DefaultMessageSourceResolvable; diff --git a/src/main/java/com/funeat/member/domain/Member.java b/src/main/java/com/funeat/member/domain/Member.java index 2096d0ff..fb0fd962 100644 --- a/src/main/java/com/funeat/member/domain/Member.java +++ b/src/main/java/com/funeat/member/domain/Member.java @@ -8,11 +8,11 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.OneToMany; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; import org.springframework.util.StringUtils; @Entity diff --git a/src/main/java/com/funeat/member/domain/favorite/RecipeFavorite.java b/src/main/java/com/funeat/member/domain/favorite/RecipeFavorite.java index 161f8348..f022b70a 100644 --- a/src/main/java/com/funeat/member/domain/favorite/RecipeFavorite.java +++ b/src/main/java/com/funeat/member/domain/favorite/RecipeFavorite.java @@ -2,15 +2,15 @@ import com.funeat.member.domain.Member; import com.funeat.recipe.domain.Recipe; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Entity @Table(uniqueConstraints = @UniqueConstraint(columnNames = {"member_id", "recipe_id"})) diff --git a/src/main/java/com/funeat/member/domain/favorite/ReviewFavorite.java b/src/main/java/com/funeat/member/domain/favorite/ReviewFavorite.java index 7e8768f4..83b4913a 100644 --- a/src/main/java/com/funeat/member/domain/favorite/ReviewFavorite.java +++ b/src/main/java/com/funeat/member/domain/favorite/ReviewFavorite.java @@ -2,15 +2,15 @@ import com.funeat.member.domain.Member; import com.funeat.review.domain.Review; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Entity @Table(uniqueConstraints = @UniqueConstraint(columnNames = {"member_id", "review_id"})) diff --git a/src/main/java/com/funeat/member/dto/MemberRequest.java b/src/main/java/com/funeat/member/dto/MemberRequest.java index c8a2f972..a5e3c5e0 100644 --- a/src/main/java/com/funeat/member/dto/MemberRequest.java +++ b/src/main/java/com/funeat/member/dto/MemberRequest.java @@ -1,7 +1,7 @@ package com.funeat.member.dto; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; public class MemberRequest { diff --git a/src/main/java/com/funeat/member/presentation/MemberApiController.java b/src/main/java/com/funeat/member/presentation/MemberApiController.java index af00932f..ea0db940 100644 --- a/src/main/java/com/funeat/member/presentation/MemberApiController.java +++ b/src/main/java/com/funeat/member/presentation/MemberApiController.java @@ -10,7 +10,7 @@ import com.funeat.member.dto.MemberReviewsResponse; import com.funeat.recipe.application.RecipeService; import com.funeat.review.application.ReviewService; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.springframework.data.domain.Pageable; import org.springframework.data.web.PageableDefault; import org.springframework.http.MediaType; diff --git a/src/main/java/com/funeat/product/domain/Category.java b/src/main/java/com/funeat/product/domain/Category.java index 7504aad1..9357b565 100644 --- a/src/main/java/com/funeat/product/domain/Category.java +++ b/src/main/java/com/funeat/product/domain/Category.java @@ -1,11 +1,11 @@ package com.funeat.product.domain; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; @Entity public class Category { diff --git a/src/main/java/com/funeat/product/domain/Product.java b/src/main/java/com/funeat/product/domain/Product.java index a95a7b91..9c9f4a08 100644 --- a/src/main/java/com/funeat/product/domain/Product.java +++ b/src/main/java/com/funeat/product/domain/Product.java @@ -2,14 +2,14 @@ import com.funeat.review.domain.Review; import java.util.List; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; @Entity public class Product { diff --git a/src/main/java/com/funeat/product/domain/ProductRecipe.java b/src/main/java/com/funeat/product/domain/ProductRecipe.java index 4bca08c3..a3b5e9ad 100644 --- a/src/main/java/com/funeat/product/domain/ProductRecipe.java +++ b/src/main/java/com/funeat/product/domain/ProductRecipe.java @@ -1,13 +1,13 @@ package com.funeat.product.domain; import com.funeat.recipe.domain.Recipe; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; @Entity public class ProductRecipe { diff --git a/src/main/java/com/funeat/product/persistence/ProductSpecification.java b/src/main/java/com/funeat/product/persistence/ProductSpecification.java index f2dbd2ff..1e5df26c 100644 --- a/src/main/java/com/funeat/product/persistence/ProductSpecification.java +++ b/src/main/java/com/funeat/product/persistence/ProductSpecification.java @@ -7,10 +7,10 @@ import com.funeat.product.dto.ProductSortCondition; import com.funeat.product.exception.ProductException.NotSupportedProductSortingConditionException; import java.util.Objects; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Path; -import javax.persistence.criteria.Root; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Path; +import jakarta.persistence.criteria.Root; import org.springframework.data.jpa.domain.Specification; public class ProductSpecification { diff --git a/src/main/java/com/funeat/recipe/domain/Recipe.java b/src/main/java/com/funeat/recipe/domain/Recipe.java index 5ffb0438..96122b55 100644 --- a/src/main/java/com/funeat/recipe/domain/Recipe.java +++ b/src/main/java/com/funeat/recipe/domain/Recipe.java @@ -3,14 +3,14 @@ import com.funeat.member.domain.Member; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; @Entity public class Recipe { diff --git a/src/main/java/com/funeat/recipe/domain/RecipeImage.java b/src/main/java/com/funeat/recipe/domain/RecipeImage.java index 0dffc61e..e55ad6ef 100644 --- a/src/main/java/com/funeat/recipe/domain/RecipeImage.java +++ b/src/main/java/com/funeat/recipe/domain/RecipeImage.java @@ -1,12 +1,12 @@ package com.funeat.recipe.domain; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; @Entity public class RecipeImage { diff --git a/src/main/java/com/funeat/recipe/dto/RecipeCommentCreateRequest.java b/src/main/java/com/funeat/recipe/dto/RecipeCommentCreateRequest.java index 2b24e920..1733246e 100644 --- a/src/main/java/com/funeat/recipe/dto/RecipeCommentCreateRequest.java +++ b/src/main/java/com/funeat/recipe/dto/RecipeCommentCreateRequest.java @@ -1,8 +1,8 @@ package com.funeat.recipe.dto; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; public class RecipeCommentCreateRequest { diff --git a/src/main/java/com/funeat/recipe/dto/RecipeCreateRequest.java b/src/main/java/com/funeat/recipe/dto/RecipeCreateRequest.java index 201c28cf..27d03c3e 100644 --- a/src/main/java/com/funeat/recipe/dto/RecipeCreateRequest.java +++ b/src/main/java/com/funeat/recipe/dto/RecipeCreateRequest.java @@ -1,9 +1,9 @@ package com.funeat.recipe.dto; import java.util.List; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; public class RecipeCreateRequest { diff --git a/src/main/java/com/funeat/recipe/dto/RecipeFavoriteRequest.java b/src/main/java/com/funeat/recipe/dto/RecipeFavoriteRequest.java index f82ada42..e54f2059 100644 --- a/src/main/java/com/funeat/recipe/dto/RecipeFavoriteRequest.java +++ b/src/main/java/com/funeat/recipe/dto/RecipeFavoriteRequest.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class RecipeFavoriteRequest { diff --git a/src/main/java/com/funeat/recipe/persistence/RecipeRepository.java b/src/main/java/com/funeat/recipe/persistence/RecipeRepository.java index ce5ef3c3..ab97a05a 100644 --- a/src/main/java/com/funeat/recipe/persistence/RecipeRepository.java +++ b/src/main/java/com/funeat/recipe/persistence/RecipeRepository.java @@ -1,6 +1,6 @@ package com.funeat.recipe.persistence; -import static javax.persistence.LockModeType.PESSIMISTIC_WRITE; +import static jakarta.persistence.LockModeType.PESSIMISTIC_WRITE; import com.funeat.member.domain.Member; import com.funeat.product.domain.Product; diff --git a/src/main/java/com/funeat/recipe/presentation/RecipeApiController.java b/src/main/java/com/funeat/recipe/presentation/RecipeApiController.java index 17eb1f1d..766a02aa 100644 --- a/src/main/java/com/funeat/recipe/presentation/RecipeApiController.java +++ b/src/main/java/com/funeat/recipe/presentation/RecipeApiController.java @@ -15,7 +15,7 @@ import com.funeat.recipe.dto.SortingRecipesResponse; import java.net.URI; import java.util.List; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.web.PageableDefault; diff --git a/src/main/java/com/funeat/recipe/util/RecipeDetailHandlerInterceptor.java b/src/main/java/com/funeat/recipe/util/RecipeDetailHandlerInterceptor.java index 9bca8ce2..9f16d37b 100644 --- a/src/main/java/com/funeat/recipe/util/RecipeDetailHandlerInterceptor.java +++ b/src/main/java/com/funeat/recipe/util/RecipeDetailHandlerInterceptor.java @@ -3,9 +3,9 @@ import com.funeat.auth.exception.AuthErrorCode; import com.funeat.auth.exception.AuthException.NotLoggedInException; import java.util.Objects; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; diff --git a/src/main/java/com/funeat/recipe/util/RecipeHandlerInterceptor.java b/src/main/java/com/funeat/recipe/util/RecipeHandlerInterceptor.java index 192f5714..d82e55ba 100644 --- a/src/main/java/com/funeat/recipe/util/RecipeHandlerInterceptor.java +++ b/src/main/java/com/funeat/recipe/util/RecipeHandlerInterceptor.java @@ -3,9 +3,9 @@ import com.funeat.auth.exception.AuthErrorCode; import com.funeat.auth.exception.AuthException.NotLoggedInException; import java.util.Objects; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; diff --git a/src/main/java/com/funeat/review/domain/Review.java b/src/main/java/com/funeat/review/domain/Review.java index 9b1a458d..cd75dc2b 100644 --- a/src/main/java/com/funeat/review/domain/Review.java +++ b/src/main/java/com/funeat/review/domain/Review.java @@ -8,15 +8,15 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; @Entity public class Review { diff --git a/src/main/java/com/funeat/review/domain/ReviewTag.java b/src/main/java/com/funeat/review/domain/ReviewTag.java index 72b54974..8d49803b 100644 --- a/src/main/java/com/funeat/review/domain/ReviewTag.java +++ b/src/main/java/com/funeat/review/domain/ReviewTag.java @@ -1,13 +1,13 @@ package com.funeat.review.domain; import com.funeat.tag.domain.Tag; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; @Entity public class ReviewTag { diff --git a/src/main/java/com/funeat/review/dto/ReviewCreateRequest.java b/src/main/java/com/funeat/review/dto/ReviewCreateRequest.java index ce1e9a71..9cb30681 100644 --- a/src/main/java/com/funeat/review/dto/ReviewCreateRequest.java +++ b/src/main/java/com/funeat/review/dto/ReviewCreateRequest.java @@ -1,9 +1,9 @@ package com.funeat.review.dto; import java.util.List; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; public class ReviewCreateRequest { diff --git a/src/main/java/com/funeat/review/dto/ReviewFavoriteRequest.java b/src/main/java/com/funeat/review/dto/ReviewFavoriteRequest.java index ea301730..85c3702e 100644 --- a/src/main/java/com/funeat/review/dto/ReviewFavoriteRequest.java +++ b/src/main/java/com/funeat/review/dto/ReviewFavoriteRequest.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public class ReviewFavoriteRequest { diff --git a/src/main/java/com/funeat/review/dto/SortingReviewRequest.java b/src/main/java/com/funeat/review/dto/SortingReviewRequest.java index b6bdeb1e..244781c5 100644 --- a/src/main/java/com/funeat/review/dto/SortingReviewRequest.java +++ b/src/main/java/com/funeat/review/dto/SortingReviewRequest.java @@ -1,7 +1,7 @@ package com.funeat.review.dto; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.PositiveOrZero; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.PositiveOrZero; public class SortingReviewRequest { diff --git a/src/main/java/com/funeat/review/persistence/ReviewRepository.java b/src/main/java/com/funeat/review/persistence/ReviewRepository.java index 69d35018..12db0f94 100644 --- a/src/main/java/com/funeat/review/persistence/ReviewRepository.java +++ b/src/main/java/com/funeat/review/persistence/ReviewRepository.java @@ -1,6 +1,6 @@ package com.funeat.review.persistence; -import static javax.persistence.LockModeType.PESSIMISTIC_WRITE; +import static jakarta.persistence.LockModeType.PESSIMISTIC_WRITE; import com.funeat.member.domain.Member; import com.funeat.product.domain.Product; diff --git a/src/main/java/com/funeat/review/persistence/ReviewRepositoryImpl.java b/src/main/java/com/funeat/review/persistence/ReviewRepositoryImpl.java index ae47f712..4281152f 100644 --- a/src/main/java/com/funeat/review/persistence/ReviewRepositoryImpl.java +++ b/src/main/java/com/funeat/review/persistence/ReviewRepositoryImpl.java @@ -5,17 +5,17 @@ import com.funeat.review.domain.Review; import com.funeat.review.dto.SortingReviewDtoWithoutTag; import java.util.List; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.CompoundSelection; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Join; -import javax.persistence.criteria.JoinType; -import javax.persistence.criteria.Order; -import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.persistence.TypedQuery; +import jakarta.persistence.criteria.CompoundSelection; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Join; +import jakarta.persistence.criteria.JoinType; +import jakarta.persistence.criteria.Order; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/funeat/review/presentation/ReviewApiController.java b/src/main/java/com/funeat/review/presentation/ReviewApiController.java index ff82ff49..8595e950 100644 --- a/src/main/java/com/funeat/review/presentation/ReviewApiController.java +++ b/src/main/java/com/funeat/review/presentation/ReviewApiController.java @@ -13,7 +13,7 @@ import com.funeat.review.dto.SortingReviewsResponse; import java.net.URI; import java.util.Optional; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; diff --git a/src/main/java/com/funeat/review/specification/SortingReviewSpecification.java b/src/main/java/com/funeat/review/specification/SortingReviewSpecification.java index 78103201..bae0cb2e 100644 --- a/src/main/java/com/funeat/review/specification/SortingReviewSpecification.java +++ b/src/main/java/com/funeat/review/specification/SortingReviewSpecification.java @@ -8,10 +8,10 @@ import java.time.LocalDateTime; import java.util.List; import java.util.Objects; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.Path; -import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.Path; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; import org.springframework.data.jpa.domain.Specification; public final class SortingReviewSpecification { diff --git a/src/main/java/com/funeat/tag/domain/Tag.java b/src/main/java/com/funeat/tag/domain/Tag.java index 554b8db6..a79f70b8 100644 --- a/src/main/java/com/funeat/tag/domain/Tag.java +++ b/src/main/java/com/funeat/tag/domain/Tag.java @@ -1,11 +1,11 @@ package com.funeat.tag.domain; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; @Entity public class Tag { diff --git a/src/test/java/com/funeat/acceptance/auth/LoginSteps.java b/src/test/java/com/funeat/acceptance/auth/LoginSteps.java index 92d2f48c..a160c1e4 100644 --- a/src/test/java/com/funeat/acceptance/auth/LoginSteps.java +++ b/src/test/java/com/funeat/acceptance/auth/LoginSteps.java @@ -22,8 +22,10 @@ public class LoginSteps { return given() .param("code", String.valueOf(memberId)) .when() + .log().all() .get("/api/login/oauth2/code/kakao") .then() + .log().all() .extract(); } @@ -40,8 +42,10 @@ public class LoginSteps { return RestAssured.given() .queryParam("code", String.valueOf(memberId)) .when() + .log().all() .get("/api/login/oauth2/code/kakao") .then() + .log().all() .extract() .response() .getCookie("SESSION"); diff --git a/src/test/java/com/funeat/acceptance/review/ReviewSteps.java b/src/test/java/com/funeat/acceptance/review/ReviewSteps.java index d1b556d7..a59003b6 100644 --- a/src/test/java/com/funeat/acceptance/review/ReviewSteps.java +++ b/src/test/java/com/funeat/acceptance/review/ReviewSteps.java @@ -28,8 +28,10 @@ public class ReviewSteps { return requestSpec .multiPart("reviewRequest", request, "application/json") .when() + .log().all() .post("/api/products/{productId}/reviews", productId) .then() + .log().all() .extract(); } @@ -87,8 +89,10 @@ public class ReviewSteps { public static ExtractableResponse 리뷰_상세_조회_요청(final Long reviewId) { return given() .when() + .log().all() .get("/api/reviews/{reviewId}", reviewId) .then() + .log().all() .extract(); } } diff --git a/src/test/java/com/funeat/common/DataCleaner.java b/src/test/java/com/funeat/common/DataCleaner.java index 9cefb2f3..aa59b267 100644 --- a/src/test/java/com/funeat/common/DataCleaner.java +++ b/src/test/java/com/funeat/common/DataCleaner.java @@ -2,10 +2,10 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.PostConstruct; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.transaction.Transactional; +import jakarta.annotation.PostConstruct; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.transaction.Transactional; import org.springframework.stereotype.Component; @Component @@ -39,8 +39,12 @@ public void clear() { private void truncate() { entityManager.createNativeQuery(String.format(FOREIGN_KEY_CHECK_FORMAT, "FALSE")).executeUpdate(); for (String tableName : tableNames) { - entityManager.createNativeQuery(String.format(TRUNCATE_FORMAT, tableName)).executeUpdate(); - entityManager.createNativeQuery(String.format(AUTO_INCREMENT_FORMAT, tableName)).executeUpdate(); + if (tableName.equals("SPRING_SESSION") || tableName.equals("SPRING_SESSION_ATTRIBUTES")) { + entityManager.createNativeQuery(String.format(TRUNCATE_FORMAT, tableName)).executeUpdate(); + } else { + entityManager.createNativeQuery(String.format(TRUNCATE_FORMAT, tableName)).executeUpdate(); + entityManager.createNativeQuery(String.format(AUTO_INCREMENT_FORMAT, tableName)).executeUpdate(); + } } entityManager.createNativeQuery(String.format(FOREIGN_KEY_CHECK_FORMAT, "TRUE")).executeUpdate(); } diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index 5d2dd038..7b3402c0 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -2,10 +2,6 @@ spring: profiles: active: test - datasource: - driver-class-name: org.h2.Driver - url: jdbc:h2:mem:test${random.uuid};MODE=MySQL - username: sa jpa: hibernate: @@ -16,7 +12,9 @@ spring: show_sql: true session: - store-type: none + jdbc: + initialize-schema: always + logging: level: From dff9ce5797362aedd409187f5378e87fde42666c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9A=B0=EA=B0=80?= Date: Thu, 18 Jan 2024 16:42:19 +0900 Subject: [PATCH 5/5] =?UTF-8?q?chore:=20kotlin=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 40 ------------------------------------- build.gradle.kts | 48 +++++++++++++++++++++++++++++++++++++++++++++ settings.gradle | 1 - settings.gradle.kts | 1 + 4 files changed, 49 insertions(+), 41 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts diff --git a/build.gradle b/build.gradle deleted file mode 100644 index ab29b57f..00000000 --- a/build.gradle +++ /dev/null @@ -1,40 +0,0 @@ -plugins { - id 'java' - id 'org.springframework.boot' version '3.2.1' - id 'io.spring.dependency-management' version '1.1.4' -} - -group = 'com.funeat' -version = '0.0.1-SNAPSHOT' - -java { - sourceCompatibility = '21' -} - -repositories { - mavenCentral() -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-validation' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-web' - runtimeOnly 'com.mysql:mysql-connector-j' - testImplementation 'org.springframework.boot:spring-boot-starter-test' - testImplementation 'io.rest-assured:rest-assured:5.3.2' - testRuntimeOnly 'com.h2database:h2' - - implementation 'org.springdoc:springdoc-openapi-ui:1.7.0' - implementation 'com.github.maricn:logback-slack-appender:1.4.0' - - implementation 'org.springframework.boot:spring-boot-starter-actuator' - runtimeOnly 'io.micrometer:micrometer-registry-prometheus' - - implementation 'com.amazonaws:aws-java-sdk-s3:1.12.547' - - implementation 'org.springframework.session:spring-session-jdbc' -} - -tasks.named('test') { - useJUnitPlatform() -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..46b9b6a4 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,48 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + id ("org.springframework.boot") version "3.2.1" + id ("io.spring.dependency-management") version "1.1.4" + id ("java") + kotlin("jvm") version "1.9.20" + kotlin("plugin.spring") version "1.9.20" + kotlin("plugin.jpa") version "1.9.20" +} + +group = "com.funeat" +version = "0.0.1-SNAPSHOT" +java.sourceCompatibility = JavaVersion.VERSION_21 + +repositories { + mavenCentral() +} + +dependencies { + implementation("org.springframework.boot:spring-boot-starter-validation") + implementation("org.springframework.boot:spring-boot-starter-data-jpa") + implementation("org.springframework.boot:spring-boot-starter-web") + runtimeOnly("com.mysql:mysql-connector-j") + testImplementation("org.springframework.boot:spring-boot-starter-test") + testImplementation("io.rest-assured:rest-assured:5.3.2") + testRuntimeOnly("com.h2database:h2") + + implementation("org.springdoc:springdoc-openapi-ui:1.7.0") + implementation("com.github.maricn:logback-slack-appender:1.4.0") + + implementation("org.springframework.boot:spring-boot-starter-actuator") + runtimeOnly("io.micrometer:micrometer-registry-prometheus") + + implementation("com.amazonaws:aws-java-sdk-s3:1.12.547") + + implementation("org.springframework.session:spring-session-jdbc") +} + +tasks.withType { + kotlinOptions { + jvmTarget = "21" + } +} + +tasks.withType { + useJUnitPlatform() +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 7f580408..00000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'funeat' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..409ea542 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "funeat"