-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#43] feat: ErrorCode 저장용 Enum 클래스 생성
- Loading branch information
1 parent
f9e1255
commit a11a998
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/com/study/realworld/global/error/exception/ErrorCode.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,32 @@ | ||
package com.study.realworld.global.error.exception; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.OBJECT) | ||
public enum ErrorCode { | ||
; | ||
|
||
private final HttpStatus status; | ||
private final String code; | ||
private final String message; | ||
|
||
ErrorCode(HttpStatus status, String code, String message) { | ||
this.status = status; | ||
this.code = code; | ||
this.message = message; | ||
} | ||
|
||
public HttpStatus getStatus() { | ||
return status; | ||
} | ||
|
||
public String getCode() { | ||
return code; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
} |