로빙 레벨 1 표시 문제 해결 완료 - 전체 플로우 작동 확인

This commit is contained in:
happybell80 2025-08-28 16:13:50 +09:00
parent c590db4ea9
commit 32ab3d65f9
3 changed files with 62 additions and 30 deletions

View File

@ -66,18 +66,17 @@
3. **Scopes 파싱 문제**:
- PostgreSQL에 문자열로 저장된 scopes를 JSON 배열로 변환
## 2025-08-28 추가 활용
## 2025-08-28 활용 결과
### 로빙 레벨 문제 해결
- **문제**: rb8001이 하드코딩된 레벨 1 반환
- **해결**: robeing-monitor의 `/api/stats/{robeing_id}` 활용
- **필요 작업**:
1. 51124: state_service를 main.py에 /api 경로로 마운트
```python
app.mount("/api", state_service.app) # /healthz 충돌 방지
```
2. 51123: Gateway에서 로빙 모니터 API 호출로 변경
- **효과**: DB의 실제 레벨(20) 표시
### 로빙 레벨 문제 부분 해결
- **완료**: state_service `/api` 마운트 ✅
- **완료**: Gateway → robeing-monitor 통합 ✅
- **완료**: DB 스탯 컬럼 추가 ✅
- **확인**: 직접 호출 시 레벨 20 반환 ✅
### 해결 방법 확인
- **문제**: Frontend가 `/api/user/robeing` 호출 → 404
- **해결**: `/api/robeing/info`로 변경 (Gateway에 구현됨)
## 남은 작업 사항

View File

@ -1,7 +1,8 @@
# rb8001 레벨 1 표시 문제 해결
## 작성일: 2025-08-23
## 작성일: 2025-08-23 (수정: 2025-08-28)
## 작성자: happybell80 with Claude
## 상태: ✅ 해결 완료
---
@ -115,18 +116,49 @@ if robeing_id == "rb8001" and "stats" in data:
---
## 4. 해결 방안 (2025-08-28 추가)
## 4. 해결 진행 (2025-08-28)
### 로빙 모니터 API 활용
- **51124 서버**: robeing-monitor (포트 9024) 실행 중
- **문제**: `/api/stats/{robeing_id}` 엔드포인트가 main.py에 마운트 안됨
- **해결**: 51124에서 state_service를 main.py에 /api 경로로 마운트
- **Gateway 수정**:
### 4.1 완료된 작업 ✅
- **robeing-monitor**: state_service를 `/api` 경로로 마운트
- **Gateway**: 모든 로빙을 robeing-monitor로 통합
```python
# rb8001 하드코딩 대신 로빙 모니터 호출
# state_service가 /api에 마운트됨
# 조건문 제거, 모든 로빙 통합
target_url = f"http://192.168.219.52:9024/api/stats/{robeing_id}"
```
- **DB**: robeing_stats에 스탯 컬럼 추가 (memory, compute 등)
- **테스트**: robeing-monitor 직접 호출 시 레벨 20 반환 확인
### 4.2 새로운 문제 발견 및 해결 완료 ✅
**robeing_id가 undefined로 전달됨**
```
Gateway 로그:
GET /api/stats/undefined HTTP/1.0" 200 OK
GET /api/user/robeing → 404 Not Found
```
**원인**: Frontend가 잘못된 엔드포인트 호출
- 시도: `/api/user/robeing` (없음)
- 실제: `/api/robeing/info` (Gateway에 있음)
**해결 완료 (로컬 개발자)**:
1. **Gateway**: `/api/robeing/info` JWT 인증 적용 ✅
```python
x_user_id: str = Depends(get_verified_user)
```
2. **Frontend**: 엔드포인트 변경 ✅
```javascript
// 변경 전: /api/user/robeing
// 변경 후: /api/robeing/info
```
### 4.3 최종 플로우
```
Frontend (JWT) → Gateway /api/robeing/info → robeing_id 획득
/api/stats/{robeing_id} → robeing-monitor → DB
레벨 20 반환 ✅
```
---

View File

@ -2,7 +2,7 @@
## 작성일: 2025-08-25
## 작성자: 서버 관리자
## 상태: 미해결 (51124 서버 코드 수정 필요)
## 상태: 부분 해결 (2025-08-28) - robeing_id undefined 문제 남음
---
@ -165,16 +165,17 @@ useEffect(() => {
<div>💎 {stats?.coins || 0}</div>
```
### 중기 (51124 서버 수정 필요)
### ✅ 해결 완료 (2025-08-28)
#### 1. ~~rb8001 서비스 수정~~ → 로빙 모니터 활용 (2025-08-28)
- **새 방안**: robeing-monitor API 사용
- **51124 작업**: state_service를 main.py에 /api 경로로 마운트 (app.mount("/api", state_service.app))
- **51123 작업**: Gateway에서 로빙 모니터 호출로 변경
```python
# state_service가 /api에 마운트됨
target_url = f"http://192.168.219.52:9024/api/stats/{robeing_id}"
```
#### robeing-monitor 활용으로 해결
- **완료**: state_service를 `/api` 경로로 마운트
- **완료**: Gateway 모든 로빙 → robeing-monitor 통합
- **완료**: DB 스탯 컬럼 추가
- **확인**: 레벨 20 정상 반환 (직접 호출 시)
#### ✅ 해결 방법: Frontend 엔드포인트 수정
- 문제: `/api/user/robeing` → 404
- 해결: `/api/robeing/info`로 변경 (Gateway에 있음)
---