-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[feat] : 차트 선택 지표 목록 조회 API 구현 (GET)
- Loading branch information
Showing
10 changed files
with
180 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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 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
37 changes: 37 additions & 0 deletions
37
backend/src/main/java/org/dgu/backend/exception/CandleErrorResult.java
This file contains 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,37 @@ | ||
package org.dgu.backend.exception; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.dgu.backend.common.code.BaseErrorCode; | ||
import org.dgu.backend.common.dto.ErrorReasonDto; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum CandleErrorResult implements BaseErrorCode { | ||
NOT_FOUND_CANDLE(HttpStatus.NOT_FOUND, "404", "존재하지 않는 캔들입니다."), | ||
NOT_FOUND_CANDLES(HttpStatus.NOT_FOUND, "404", "캔들 목록이 존재하지 않습니다."); | ||
|
||
private final HttpStatus httpStatus; | ||
private final String code; | ||
private final String message; | ||
|
||
@Override | ||
public ErrorReasonDto getReason() { | ||
return ErrorReasonDto.builder() | ||
.isSuccess(false) | ||
.code(code) | ||
.message(message) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ErrorReasonDto getReasonHttpStatus() { | ||
return ErrorReasonDto.builder() | ||
.isSuccess(false) | ||
.httpStatus(httpStatus) | ||
.code(code) | ||
.message(message) | ||
.build(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
backend/src/main/java/org/dgu/backend/exception/CandleException.java
This file contains 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,15 @@ | ||
package org.dgu.backend.exception; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class CandleException extends RuntimeException { | ||
private final CandleErrorResult candleErrorResult; | ||
|
||
@Override | ||
public String getMessage() { | ||
return candleErrorResult.getMessage(); | ||
} | ||
} |
This file contains 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
37 changes: 37 additions & 0 deletions
37
backend/src/main/java/org/dgu/backend/exception/MarketErrorResult.java
This file contains 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,37 @@ | ||
package org.dgu.backend.exception; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.dgu.backend.common.code.BaseErrorCode; | ||
import org.dgu.backend.common.dto.ErrorReasonDto; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum MarketErrorResult implements BaseErrorCode { | ||
NOT_FOUND_MARKET(HttpStatus.NOT_FOUND, "404", "존재하지 않는 가상화폐입니다."), | ||
NOT_FOUND_MARKETS(HttpStatus.NOT_FOUND, "404", "가상화폐 목록이 존재하지 않습니다."); | ||
|
||
private final HttpStatus httpStatus; | ||
private final String code; | ||
private final String message; | ||
|
||
@Override | ||
public ErrorReasonDto getReason() { | ||
return ErrorReasonDto.builder() | ||
.isSuccess(false) | ||
.code(code) | ||
.message(message) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ErrorReasonDto getReasonHttpStatus() { | ||
return ErrorReasonDto.builder() | ||
.isSuccess(false) | ||
.httpStatus(httpStatus) | ||
.code(code) | ||
.message(message) | ||
.build(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
backend/src/main/java/org/dgu/backend/exception/MarketException.java
This file contains 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,15 @@ | ||
package org.dgu.backend.exception; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class MarketException extends RuntimeException { | ||
private final MarketErrorResult marketErrorResult; | ||
|
||
@Override | ||
public String getMessage() { | ||
return marketErrorResult.getMessage(); | ||
} | ||
} |
This file contains 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 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