-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor(coin): coin 도메인 리팩토링 및 테스트 코드 작성 #99
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다
...in/java/com/project/bumawiki/domain/coin/domain/TradeWithoutTradeStatusAndCoinAccountId.java
Outdated
Show resolved
Hide resolved
src/test/java/com/project/bumawiki/domain/coin/service/QueryCoinServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/project/bumawiki/domain/coin/service/QueryCoinServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/project/bumawiki/global/service/FixtureGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/com/project/bumawiki/domain/coin/service/PriceScheduler.java
Outdated
Show resolved
Hide resolved
src/main/java/com/project/bumawiki/domain/coin/service/CommandCoinService.java
Outdated
Show resolved
Hide resolved
TradeWithoutTradeStatusAndCoinAccountId 가 정확하지만 한번에 읽히지 않는다는 단점이 있는거 같아요. |
src/main/java/com/project/bumawiki/domain/coin/implementation/CoinAccountReader.java
Outdated
Show resolved
Hide resolved
src/main/java/com/project/bumawiki/domain/coin/implementation/CoinAccountValidator.java
Show resolved
Hide resolved
src/main/java/com/project/bumawiki/domain/coin/service/CommandCoinService.java
Outdated
Show resolved
Hide resolved
다시 한 번 생각해보겠습니다! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳입니다~ 정리 잘 하셨네요! 남은거 화이팅입니다!
src/main/java/com/project/bumawiki/domain/coin/service/CommandCoinService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/project/bumawiki/domain/coin/service/CommandCoinService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/project/bumawiki/domain/coin/service/PriceScheduler.java
Outdated
Show resolved
Hide resolved
public List<Price> getPriceByPeriod(String period) { | ||
switch (period) { | ||
case "full" -> { | ||
return priceReader.findAllByOrderByStartedTime(); | ||
} | ||
case "halfMonth" -> { | ||
LocalDateTime twoWeeksAgo = LocalDateTime.now().minusWeeks(2); | ||
return priceReader.findAllAfterStartedTime(twoWeeksAgo); | ||
} | ||
case "week" -> { | ||
LocalDateTime oneWeekAgo = LocalDateTime.now().minusWeeks(1); | ||
return priceReader.findAllAfterStartedTime(oneWeekAgo); | ||
} | ||
case "day" -> { | ||
LocalDateTime oneDayAgo = LocalDateTime.now().minusDays(1); | ||
return priceReader.findAllAfterStartedTime(oneDayAgo); | ||
} | ||
case "halfDay" -> { | ||
LocalDateTime halfDayAgo = LocalDateTime.now().minusHours(12); | ||
return priceReader.findAllAfterStartedTime(halfDayAgo); | ||
} | ||
case "threeHours" -> { | ||
LocalDateTime threeHoursAgo = LocalDateTime.now().minusHours(3); | ||
return priceReader.findAllAfterStartedTime(threeHoursAgo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
항상 이런 코드를 볼 때 마다 느끼는 것인데, 더 좋은 방법이 없을까요?
close #92
리팩토링도 리팩토링이지만 테스트 코드를 중점적으로 봐주시면 감사하겠습니다!
양이 많기도 했고 시간도 조금 부족했어서 하드 코딩한 부분들이 좀 있을 겁니다..
진행한 작업
이외에
코드 리뷰 진행 중 Read-only Transaction에서 save메서드를 사용한 기존 코드로 인해 아래와 같은 에러가 떴던 부분을 수정했습니다!