Skip to content

Commit

Permalink
#42 [feat] : 비트코인 일봉 차트 조회 API 구현 (GET)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbang105 committed Jun 9, 2024
1 parent d8832f1 commit 67c59a5
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import lombok.RequiredArgsConstructor;
import org.dgu.backend.common.ApiResponse;
import org.dgu.backend.common.constant.SuccessStatus;
import org.dgu.backend.dto.ChartDto;
import org.dgu.backend.dto.DashBoardDto;
import org.dgu.backend.service.ChartService;
import org.dgu.backend.service.DashBoardService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand All @@ -15,6 +17,7 @@
@RequiredArgsConstructor
public class DashBoardController {
private final DashBoardService dashBoardService;
private final ChartService chartService;

// 유저 업비트 잔고 조회 API
@GetMapping("/accounts")
Expand All @@ -41,4 +44,12 @@ public ResponseEntity<ApiResponse<List<DashBoardDto.RepresentativeCoinResponse>>
List<DashBoardDto.RepresentativeCoinResponse> representativeCoinResponses = dashBoardService.getRepresentativeCoins();
return ApiResponse.onSuccess(SuccessStatus.SUCCESS_GET_REPRESENTATIVE_COINS, representativeCoinResponses);
}

// 비트코인 차트 (일봉) 조회 API
@GetMapping("/bit-charts")
public ResponseEntity<ApiResponse<List<ChartDto.OHLCVResponse>>> getBitcoinDayCharts() {

List<ChartDto.OHLCVResponse> ohlcvResponses = chartService.getOHLCVCharts("비트코인", "days");
return ApiResponse.onSuccess(SuccessStatus.SUCCESS_GET_BITCOIN_DAY_CHARTS, ohlcvResponses);
}
}

0 comments on commit 67c59a5

Please sign in to comment.