Replies: 2 comments 2 replies
-
|
이것도 멘토링 시간에 의견 들어보고, FE분들이 어떤 응답이 편하실지 논의해보면 좋겠네요! 저는 HTTP Status Code에 충분히 담겨있다고 생각해서 아래와 같은 모습을 생각했습니다. 성공 시HTTP Status Code: 200
{
"orderId": "a1b2c3d4-e5f6-7g8h-9i0j-k1l2m3n4o5p6",
"registeredAt": "2025-10-05T14:48:00",
"message": "Payment request sent to PG server."
}실패 시HTTP Status Code: 403
{
"message": "forbidden"
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
제가 클라이언트 쪽 담당했었을 때는 아래와 같은 구조가 작업하기 편했던거 같아요 성공시"code": "00000",
"msg": "success",
"data": {
"orderId": "a1b2c3d4-e5f6-7g8h-9i0j-k1l2m3n4o5p6",
"registeredAt": "2025-10-05T14:48:00",
}실패시"code": "10000", // <- 해당 코드로 UI 를 분기 처리 하는데 사용할 수도 있습니다.
"msg": "인증된 사용자가 아닙니다.", // <- 이 메세지를 사용해서 주로 얼럿 창에 보여줬었습니다
"data": nullhttp status code도 확인하긴 하지만 성공이든 실패든 동일한 형태의 body가 내려오면 작업하기 훨씬 수월했었습니다! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
PaymentError
PaymentResponse
ExceptionHandler 구성 예
{
"success": "boolean",
"data": {
reponseData: T
},
"error": "string"
}
형식으로 응답을 내려줄 수 있도록 구상한 내용입니다.
응답 예시
Beta Was this translation helpful? Give feedback.
All reactions