Skip to content

Commit

Permalink
Merge pull request #49 from CSID-DGU/feature/#48/upbit-keys
Browse files Browse the repository at this point in the history
[refactor] : 일부 API 응답 값 추가
  • Loading branch information
bbbang105 authored Jun 6, 2024
2 parents 28ec742 + 3edec4f commit d7cf0d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public static class BackTestingResponse {
private Trading trading;
private Performance performance;
private List<TradingLog> tradingLogs;
private Boolean isSaved;

public void addId(UUID portfolioId) {
this.portfolioId = portfolioId;
Expand Down Expand Up @@ -146,11 +147,12 @@ public PerformanceResult toPerformanceResult(Portfolio portfolio) {
}

public static BackTestingDto.BackTestingResponse of(Portfolio portfolio, TradingResult tradingResult, PerformanceResult performanceResult, List<org.dgu.backend.domain.TradingLog> tradingLogs) {
return BackTestingDto.BackTestingResponse.builder()
return BackTestingResponse.builder()
.portfolioId(portfolio.getPortfolioId())
.trading(Trading.of(tradingResult))
.performance(Performance.of(performanceResult))
.tradingLogs(TradingLog.ofTradingLogs(tradingLogs))
.isSaved(portfolio.getIsSaved())
.build();
}
}
Expand Down
6 changes: 4 additions & 2 deletions backend/src/main/java/org/dgu/backend/dto/PortfolioDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ public static class PortfolioInfos {
private String startDate;
private String endDate;
private String candleName;
private boolean isTrade;
private Boolean isMarked;
private Boolean isTrade;

public static PortfolioDto.PortfolioInfos of(Portfolio portfolio, PortfolioOption portfolioOption, UUID currentPortfolioId) {
return PortfolioDto.PortfolioInfos.builder()
return PortfolioInfos.builder()
.portfolioId(portfolio.getPortfolioId())
.title(portfolio.getTitle())
.startDate(String.valueOf(portfolioOption.getStartDate()))
.endDate(String.valueOf(portfolioOption.getEndDate()))
.candleName(portfolioOption.getCandleName())
.isMarked(portfolio.getIsMarked())
.isTrade(Objects.equals(portfolio.getPortfolioId(), currentPortfolioId))
.build();
}
Expand Down

0 comments on commit d7cf0d7

Please sign in to comment.