-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MARA-88 : 환경별 리다이렉트 uri 구분을 위한 status 값 추가, 나눔 변수 추가 및 수정, 전역 예외 처리 및…
… 커스텀 예외 클래스 추가 (#49) * feat: redirect Uri 변경을 위한 status 값 추가 * refactor: status enum 추가 , customException 추가, 나눔 변수 수정,추가 * refactor: ex message 변경 * refactor: error response 이름 변경, ex message 변경, status enum 공통화 * refactor: formatting * refactor: add exception data * refactor: add exception data * 예외 처리 코드 리팩토링 * exception 폴더 구조 변경 및 custom exception 추가 * S3 Custom Exception 추가 * Http 403 status Handling 예제 추가 * refactor: exception 처리 공통 클래스로 처리 --------- Co-authored-by: blackswitch <[email protected]> Co-authored-by: gwon188 <[email protected]>
- Loading branch information
1 parent
aadf7d5
commit f2ea2b8
Showing
16 changed files
with
170 additions
and
51 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
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 |
---|---|---|
@@ -1,8 +1,19 @@ | ||
package mara.server.common | ||
|
||
import org.springframework.http.HttpStatus | ||
import org.springframework.http.ResponseEntity | ||
|
||
data class CommonResponse<T>( | ||
var message: String = "ok", | ||
var data: T? = null, | ||
) | ||
|
||
data class ErrorResponse( | ||
var message: String | ||
) | ||
|
||
fun <T> success(data: T? = null): CommonResponse<T> = CommonResponse(data = data) | ||
|
||
fun fail(httpStatus: HttpStatus, message: String): ResponseEntity<ErrorResponse> = ResponseEntity | ||
.status(httpStatus) | ||
.body(ErrorResponse(message = message)) |
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
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
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
Oops, something went wrong.