diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml
index 1416b0a..f52ffc0 100644
--- a/WebContent/WEB-INF/web.xml
+++ b/WebContent/WEB-INF/web.xml
@@ -106,6 +106,10 @@
springapp
*.file
+
+ springapp
+ /api/*
+
/emergency.jsp
diff --git a/WebContent/WEB-INF/weblogic-web.xml b/WebContent/WEB-INF/weblogic-web.xml
index 78dcfc4..9521a95 100644
--- a/WebContent/WEB-INF/weblogic-web.xml
+++ b/WebContent/WEB-INF/weblogic-web.xml
@@ -111,6 +111,10 @@
springapp
*.file
+
+ springapp
+ /api/*
+
/emergency.jsp
diff --git a/kjb-docs/obp-api-guide.md b/kjb-docs/obp-api-guide.md
index 29e6e44..09697ce 100644
--- a/kjb-docs/obp-api-guide.md
+++ b/kjb-docs/obp-api-guide.md
@@ -15,13 +15,14 @@ OBP (OpenBanking Platform) API는 API Gateway의 메트릭 데이터와 API 정
OBP API는 모든 요청에서 `providerCode` 파라미터로 권한을 검증합니다.
- **허용 값**: `KJB` (대소문자 무시: `kjb`, `Kjb` 등 모두 가능)
-- **검증**: 요청 시 providerCode가 명시적으로 포함되어야 합니다
+- **검증**: 요청 시 providerCode가 반드시 포함되어야 합니다 (필수 파라미터)
+- **검증 실패**: 유효하지 않은 providerCode는 `BizException` 에러 발생
**예시**:
```
-GET /api/apis.json?providerCode=KJB
-GET /api/apis.json?providerCode=kjb
-GET /api/metrics/after-timeslice.json?timeslice=20251202030000&providerCode=KJB
+GET /api/apis/KJB
+GET /api/apis/000008-01/KJB
+GET /api/metrics/afterTimeslice/20251202030000/KJB
```
## API 엔드포인트
@@ -31,15 +32,19 @@ GET /api/metrics/after-timeslice.json?timeslice=20251202030000&providerCode=KJB
#### 요청
```http
-GET /api/apis.json
+GET /api/apis/{providerCode}
```
+**경로 파라미터**:
+- `providerCode` (필수): Provider 코드 (KJB만 허용, 대소문자 무시)
+
**쿼리 파라미터**:
- `pretty` (선택): `true`면 JSON을 들여쓰기 형식으로 반환
**예시**:
```bash
-curl "http://localhost:8080/monitoring/api/apis.json?pretty=true"
+curl "http://localhost:8080/monitoring/api/apis/KJB"
+curl "http://localhost:8080/monitoring/api/apis/kjb?pretty=true"
```
#### 응답
@@ -67,34 +72,6 @@ curl "http://localhost:8080/monitoring/api/apis.json?pretty=true"
- `status` (string): 상태 (1=활성)
- `description` (string): 설명
-**HTTP 상태 코드**:
-- `200 OK`: 조회 성공
-- `500 Internal Server Error`: 서버 오류
-
----
-
-### 2. API 목록 조회 (providerCode 검증)
-
-#### 요청
-
-```http
-GET /api/apis.json?providerCode=KJB
-```
-
-**쿼리 파라미터**:
-- `providerCode` (필수): Provider 코드 (KJB만 허용, 대소문자 무시)
-- `pretty` (선택): `true`면 JSON을 들여쓰기 형식으로 반환
-
-**예시**:
-```bash
-curl "http://localhost:8080/monitoring/api/apis.json?providerCode=KJB&pretty=true"
-curl "http://localhost:8080/monitoring/api/apis.json?providerCode=kjb"
-```
-
-#### 응답
-
-전체 API 목록 (응답 형식은 엔드포인트 1과 동일)
-
**HTTP 상태 코드**:
- `200 OK`: 조회 성공
- `400 Bad Request`: 유효하지 않은 providerCode
@@ -108,23 +85,25 @@ curl "http://localhost:8080/monitoring/api/apis.json?providerCode=kjb"
---
-### 3. API 목록 조회 (기관별)
+### 2. API 목록 조회 (기관별)
#### 요청
```http
-GET /api/apis.json?providerCode=KJB&partnerCode={orgCode}
+GET /api/apis/{orgCode}/{providerCode}
```
-**쿼리 파라미터**:
+**경로 파라미터**:
+- `orgCode` (필수): 기관코드 (OBP 파트너코드)
- `providerCode` (필수): Provider 코드 (KJB만 허용, 대소문자 무시)
-- `partnerCode` (필수): 기관코드 (OBP 파트너코드)
+
+**쿼리 파라미터**:
- `pretty` (선택): `true`면 JSON을 들여쓰기 형식으로 반환
**예시**:
```bash
-curl "http://localhost:8080/monitoring/api/apis.json?providerCode=KJB&partnerCode=000008-01&pretty=true"
-curl "http://localhost:8080/monitoring/api/apis.json?providerCode=kjb&partnerCode=000008-01"
+curl "http://localhost:8080/monitoring/api/apis/000008-01/KJB"
+curl "http://localhost:8080/monitoring/api/apis/000008-01/kjb?pretty=true"
```
#### 응답
@@ -137,30 +116,32 @@ curl "http://localhost:8080/monitoring/api/apis.json?providerCode=kjb&partnerCod
**HTTP 상태 코드**:
- `200 OK`: 조회 성공 (데이터 있음 또는 없음)
-- `400 Bad Request`: 유효하지 않은 providerCode 또는 partnerCode
+- `400 Bad Request`: 유효하지 않은 providerCode 또는 orgCode
- `500 Internal Server Error`: 서버 오류
---
-### 4. GwMetric 데이터 조회 (시간대 이후)
+### 3. GwMetric 데이터 조회 (시간대 이후)
#### 요청
```http
-GET /api/metrics/after-timeslice.json?timeslice={yyyyMMddHHmmss}&providerCode=KJB
+GET /api/metrics/afterTimeslice/{timeslice}/{providerCode}
```
-**쿼리 파라미터**:
+**경로 파라미터**:
- `timeslice` (필수): 조회 시작 시간대 (형식: `yyyyMMddHHmmss`)
- 예: `20251202030000` (2025-12-02 03:00:00)
- 분/초는 자동으로 정각(00:00)으로 처리됩니다
- `providerCode` (필수): Provider 코드 (KJB만 허용, 대소문자 무시)
+
+**쿼리 파라미터**:
- `pretty` (선택): `true`면 JSON을 들여쓰기 형식으로 반환
**예시**:
```bash
-curl "http://localhost:8080/monitoring/api/metrics/after-timeslice.json?timeslice=20251202030000&providerCode=KJB"
-curl "http://localhost:8080/monitoring/api/metrics/after-timeslice.json?timeslice=20251202030000&providerCode=kjb&pretty=true"
+curl "http://localhost:8080/monitoring/api/metrics/afterTimeslice/20251202030000/KJB"
+curl "http://localhost:8080/monitoring/api/metrics/afterTimeslice/20251202030000/kjb?pretty=true"
```
#### 응답
@@ -213,7 +194,7 @@ curl "http://localhost:8080/monitoring/api/metrics/after-timeslice.json?timeslic
async function getAllApis() {
try {
const response = await fetch(
- 'http://localhost:8080/monitoring/api/apis.json?pretty=true'
+ 'http://localhost:8080/monitoring/api/apis/KJB?pretty=true'
);
if (!response.ok) {
@@ -232,7 +213,7 @@ async function getAllApis() {
async function getApisByPartner(partnerCode) {
try {
const response = await fetch(
- `http://localhost:8080/monitoring/api/apis.json?providerCode=KJB&partnerCode=${partnerCode}&pretty=true`
+ `http://localhost:8080/monitoring/api/apis/${partnerCode}/KJB?pretty=true`
);
if (!response.ok) {
@@ -251,7 +232,7 @@ async function getApisByPartner(partnerCode) {
async function getMetricsAfterTimeslice(timeslice) {
try {
const response = await fetch(
- `http://localhost:8080/monitoring/api/metrics/after-timeslice.json?timeslice=${timeslice}&providerCode=KJB&pretty=true`
+ `http://localhost:8080/monitoring/api/metrics/afterTimeslice/${timeslice}/KJB?pretty=true`
);
if (!response.ok) {
@@ -282,7 +263,7 @@ const BASE_URL = 'http://localhost:8080/monitoring/api';
// 1. API 전체 목록 조회
async function getAllApis() {
try {
- const response = await axios.get(`${BASE_URL}/apis.json`, {
+ const response = await axios.get(`${BASE_URL}/apis/KJB`, {
params: { pretty: true }
});
console.log('All APIs:', response.data);
@@ -295,12 +276,8 @@ async function getAllApis() {
// 2. 기관별 API 목록 조회
async function getApisByPartner(partnerCode) {
try {
- const response = await axios.get(`${BASE_URL}/apis.json`, {
- params: {
- providerCode: 'KJB',
- partnerCode: partnerCode,
- pretty: true
- }
+ const response = await axios.get(`${BASE_URL}/apis/${partnerCode}/KJB`, {
+ params: { pretty: true }
});
console.log(`APIs for ${partnerCode}:`, response.data);
return response.data;
@@ -312,12 +289,8 @@ async function getApisByPartner(partnerCode) {
// 3. GwMetric 데이터 조회
async function getMetricsAfterTimeslice(timeslice) {
try {
- const response = await axios.get(`${BASE_URL}/metrics/after-timeslice.json`, {
- params: {
- timeslice: timeslice,
- providerCode: 'KJB',
- pretty: true
- }
+ const response = await axios.get(`${BASE_URL}/metrics/afterTimeslice/${timeslice}/KJB`, {
+ params: { pretty: true }
});
console.log(`Metrics after ${timeslice}:`, response.data);
return response.data;
@@ -341,25 +314,19 @@ public class ObpApiClient {
// 1. API 전체 목록 조회
public List