◾ 9-1. API

9.1 공통

9.1.1 공통 사항

클라이언트 → Gateway

필드 타입 필수 설명
Authorization String 필수 (GUEST 제외) Bearer {JWT}
Content-Type String 필수 (Body 있을 때) application/json

Gateway → 각 서비스 (자동 주입)

필드 타입 설명
X-User-Id UUID JWT에서 추출한 userId
X-User-Role String JWT에서 추출한 role (USER / ADMIN)

9.1.2 공통 Response 형식

성공 응답

{
  "success": true,
  "status": 200,
  "message": "OK",
  "data": { }
}

에러 응답

{
  "success": false,
  "status": 400,
  "message": "에러 메시지",
  "errors": [
    {
      "field": "필드명",
      "message": "필드별 에러 메시지"
    }
  ]
}

페이지네이션 응답

{
	"success": true,
  "status": 200,
  "message": "OK",
  "data": {
    "content": [ ... ],
    "page": 0,
    "size": 10,
    "totalElements": 42,
    "totalPages": 5,
    "sort": "createdAt,DESC"
  }
}