Skip to content

Commit

Permalink
Merge pull request #60 from CSID-DGU/feature/#42/dashboard
Browse files Browse the repository at this point in the history
[feat] : 비트코인 일봉 차트 조회 API 구현 (GET)
  • Loading branch information
bbbang105 authored Jun 9, 2024
2 parents d15bba9 + 67c59a5 commit e8f6940
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public enum SuccessStatus implements BaseCode {
SUCCESS_GET_USER_BALANCE(HttpStatus.OK, "200", "유저 업비트 잔고 조회에 성공했습니다"),
SUCCESS_GET_USER_COINS(HttpStatus.OK, "200", "유저 보유 코인 조회에 성공했습니다"),
SUCCESS_GET_REPRESENTATIVE_COINS(HttpStatus.OK, "200", "대표 코인 조회에 성공했습니다"),
SUCCESS_GET_BITCOIN_DAY_CHARTS(HttpStatus.OK, "200", "비트코인 일봉 차트 조회에 성공했습니다"),
// Upbit-Key
SUCCESS_ADD_UPBIT_KEYS(HttpStatus.CREATED, "201", "업비트 키 등록에 성공했습니다"),
// Chart
Expand Down
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 e8f6940

Please sign in to comment.