-
Notifications
You must be signed in to change notification settings - Fork 5
[FEATURE] : [Auction 도메인 필터 기반 검색 기능 추가] #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
b3f344c
Feat : 경매 종료가 임박한 진행중인 경매 목록 조회
na0th 3581808
Merge branch 'feat-pr' of https://github.com/na0th/auction into feat-pr
na0th 1edfd44
style : 코드 포맷터 빌드
na0th f3f95cc
Refactor : 마감이 얼마 안남은 경매 조회 메서드에 파라미터 추가
na0th 066a43d
Test: 마감 기한 얼마 안 남은 경매 목록 조회 : 테스트 코드 수정
na0th 2499cc3
test : 테스트 코드 수정
na0th a70040e
refactor : endingSoon -> /auction 검색 필터로 엔드포인트 합치기
na0th 1015a0f
Merge pull request #37 from na0th/feat-pr
polyglot-k 7e4e4cf
fix : startTime 을 입력 받아서 진행, 내부에서 설정하는 것보다 확장성이 넓을 것으로 고려
polyglot-k 98c1fff
refactor : Condition에서 StartTime도 받을 수 있도록 구성
polyglot-k 612079e
refactor : AuctionCriteriaRepository BooleanBuilder 를 활용하여 쿼리의 null 안…
polyglot-k 9ce20ec
test : auction test 추가 ( 현재 수정이 필요한 부분 주석 처리 되어있음)
polyglot-k 41ef16b
fix : price 관련 필터 추가, 기본 생성자 추가
polyglot-k 0350d5e
fix : AuctionCriteriaRepository에 price 관련 추가
polyglot-k fea9ddd
test : 필터 관련 테스트 추가
polyglot-k e0fedd3
feat: Resolver 를 통해서 Controller에서 QueryString 형식이 SearchCondition으로 W…
polyglot-k ca472bb
refactor : AuctionController GetMapping 에서 RequestBody 가 아닌 QueryStri…
polyglot-k 87a95ff
fix : ProductCategory enum 클래스 exception 기저 추가
polyglot-k 6b372d1
test : AuctionControllerTest 에 QueryString을 통해서 필터기반 조회 테스트
polyglot-k b5139cb
chore : 폴더 이동 및 lint 적용
polyglot-k 3da4324
fix : 불필요한 DTO 제거
polyglot-k 41828cb
fix : AuctionRepository 내에 불필요한 Repository 제거
polyglot-k 6558813
refactor : 여성의류, ~~ 처럼 enum의 name이 아니라 메뉴의 고유 이름으로 enum 반환하게 변경
polyglot-k 7138189
fix : @Deprecated 메소드 전체 제거
polyglot-k ca3a197
test : getAuctionsFilter을 통해 접근하도록 테스트 수정
polyglot-k f989092
chore : 전체 파일 내에 formatter 적용
polyglot-k 0b8f970
refactor : bid 요소 추가 (입찰 수에 따른 정렬 기준을 위해서)
polyglot-k ae1e6a1
refactor : SearchCondition SortBy 추가
polyglot-k 9ec54b7
refactor : SearchCondition SortBy 추가
polyglot-k 0af0a45
remove : 불필요한 Repository 삭제
polyglot-k bd3959d
refactor : sortBy에 따라 OrderSpecifier 로 정렬이 가능하게 수정
polyglot-k 9878732
test : Auction 도메인에 sortBy 를 추가하여 Test 진행
polyglot-k d9f899e
chore : ci&cd pipeline (ssh 기반)
polyglot-k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: Java CI/CD with Gradle | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 'develop' | ||
| - 'main' # main 브랜치에 병합될 때 트리거 | ||
|
|
||
| jobs: | ||
| ci-pipeline: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'adopt' | ||
| java-version: '21' | ||
|
|
||
| - name: Grant execute permission for Gradle Wrapper | ||
| run: chmod +x ./gradlew | ||
|
|
||
| - name: Lint and format code | ||
| run: ./gradlew editorconfigFormat | ||
|
|
||
| - name: Build with Gradle | ||
| run: ./gradlew build | ||
|
|
||
| - name: Test with Gradle | ||
| run: ./gradlew test | ||
|
|
||
| cd-pipeline: | ||
| if: github.ref == 'refs/heads/main' # main 브랜치에만 배포 실행 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: SSH로 NCP 접속하기 | ||
| uses: appleboy/ssh-action@v1.0.3 | ||
| with: | ||
| host: ${{ secrets.NCP_HOST }} | ||
| username: ${{ secrets.NCP_USERNAME }} | ||
| password: ${{ secrets.NCP_SSH_PASSWORD }} | ||
| port: ${{ secrets.NCP_SSH_PORT }} | ||
| script_stop: true | ||
| script: | | ||
| cd auction | ||
| git pull knuk ttest | ||
| chmod 777 ./gradlew | ||
| ./gradlew build | ||
| kill -9 $(lsof -t -i:8080) || echo "No process on 8080" | ||
| nohup java -jar build/libs/*SNAPSHOT.jar > ./output.log 2>&1 & |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/com/tasksprints/auction/common/config/WebConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.tasksprints.auction.common.config; | ||
|
|
||
| import com.tasksprints.auction.common.resolver.SearchConditionResolver; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.web.method.support.HandlerMethodArgumentResolver; | ||
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Configuration | ||
| public class WebConfig implements WebMvcConfigurer { | ||
| private final SearchConditionResolver searchConditionResolver; | ||
|
|
||
| public WebConfig(SearchConditionResolver searchConditionResolver) { | ||
| this.searchConditionResolver = searchConditionResolver; | ||
| } | ||
|
|
||
| @Override | ||
| public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) { | ||
| resolvers.add(searchConditionResolver); | ||
| } | ||
| } |
60 changes: 60 additions & 0 deletions
60
src/main/java/com/tasksprints/auction/common/resolver/SearchConditionResolver.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| package com.tasksprints.auction.common.resolver; | ||
|
|
||
| import com.tasksprints.auction.domain.auction.dto.request.AuctionRequest; | ||
| import com.tasksprints.auction.domain.auction.model.AuctionCategory; | ||
| import com.tasksprints.auction.domain.auction.model.AuctionStatus; | ||
| import com.tasksprints.auction.domain.product.model.ProductCategory; | ||
| import org.springframework.core.MethodParameter; | ||
| import org.springframework.stereotype.Component; | ||
| import org.springframework.web.bind.support.WebDataBinderFactory; | ||
| import org.springframework.web.context.request.NativeWebRequest; | ||
| import org.springframework.web.method.support.HandlerMethodArgumentResolver; | ||
| import org.springframework.web.method.support.ModelAndViewContainer; | ||
|
|
||
| import java.math.BigDecimal; | ||
| import java.time.LocalDateTime; | ||
| import java.time.format.DateTimeFormatter; | ||
|
|
||
| @Component | ||
| public class SearchConditionResolver implements HandlerMethodArgumentResolver { | ||
| @Override | ||
| public boolean supportsParameter(MethodParameter parameter) { | ||
| // 메서드 파라미터 타입이 AuctionRequest.SearchCondition일 때 처리 | ||
| return parameter.getParameterType().equals(AuctionRequest.SearchCondition.class); | ||
| } | ||
|
|
||
| @Override | ||
| public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, | ||
| NativeWebRequest webRequest, WebDataBinderFactory binderFactory) { | ||
|
|
||
| // QueryString에서 값을 추출 | ||
| String auctionCategory = webRequest.getParameter("auctionCategory"); | ||
| String productCategory = webRequest.getParameter("productCategory"); | ||
| String startTime = webRequest.getParameter("startTime"); | ||
| String endTime = webRequest.getParameter("endTime"); | ||
| String minPrice = webRequest.getParameter("minPrice"); | ||
| String maxPrice = webRequest.getParameter("maxPrice"); | ||
| String auctionStatus = webRequest.getParameter("auctionStatus"); | ||
| String sortBy = webRequest.getParameter("sortBy"); | ||
| // 파싱 및 변환 | ||
| AuctionCategory parsedAuctionCategory = auctionCategory != null ? AuctionCategory.fromDisplayName(auctionCategory) : null; | ||
| ProductCategory parsedProductCategory = productCategory != null ? ProductCategory.fromDisplayName(productCategory) : null; | ||
| LocalDateTime parsedStartTime = startTime != null ? LocalDateTime.parse(startTime, DateTimeFormatter.ISO_DATE_TIME) : null; | ||
| LocalDateTime parsedEndTime = endTime != null ? LocalDateTime.parse(endTime, DateTimeFormatter.ISO_DATE_TIME) : null; | ||
| BigDecimal parsedMinPrice = minPrice != null ? new BigDecimal(minPrice) : null; | ||
| BigDecimal parsedMaxPrice = maxPrice != null ? new BigDecimal(maxPrice) : null; | ||
| AuctionStatus parsedAuctionStatus = auctionStatus != null ? AuctionStatus.fromDisplayName(auctionStatus) : null; | ||
|
|
||
| // SearchCondition 객체 생성 및 반환 | ||
| return new AuctionRequest.SearchCondition( | ||
| parsedAuctionCategory, | ||
| parsedProductCategory, | ||
| parsedStartTime, | ||
| parsedEndTime, | ||
| parsedMinPrice, | ||
| parsedMaxPrice, | ||
| parsedAuctionStatus, | ||
| sortBy | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
...ain/java/com/tasksprints/auction/domain/auction/repository/CustomAuctionRepositoryV1.java
This file was deleted.
Oops, something went wrong.
6 changes: 2 additions & 4 deletions
6
.../com/tasksprints/auction/domain/auction/repository/support/AuctionCriteriaRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,10 @@ | ||
| package com.tasksprints.auction.domain.auction.repository.support; | ||
|
|
||
| import com.tasksprints.auction.domain.auction.dto.request.AuctionRequest; | ||
| import com.tasksprints.auction.domain.auction.model.Auction; | ||
| import com.tasksprints.auction.domain.auction.model.AuctionCategory; | ||
| import com.tasksprints.auction.domain.product.model.ProductCategory; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public interface AuctionCriteriaRepository { | ||
| public List<Auction> getAuctionsByFilters(ProductCategory productCategory, | ||
| AuctionCategory category); | ||
| List<Auction> getAuctionsByFilters(AuctionRequest.SearchCondition searchCondition); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.