feat: [flow-tester] API 로그 캡처 및 UI 개선

- ApiLogCapturer 추가: 플로우 실행 중 API 로그 캡처
- resolveBaseUrl() 추가: .env 환경변수 기반 baseUrl 지원
- 실행 상세 페이지: 스텝별 접기/펼치기 기능 (성공=접힘, 실패=펼침)
- JSON 가이드 및 예제 플로우 최신화
- AI 프롬프트 템플릿 업데이트
- bindExpectVariables() 추가: expect jsonPath 값에 변수 바인딩 적용
- areNumericEqual() 추가: 숫자 타입 유연 비교 ("2" == 2)
This commit is contained in:
2025-12-04 15:30:04 +09:00
parent 20cfa01579
commit fe10cae06c
9 changed files with 709 additions and 143 deletions

View File

@@ -53,6 +53,7 @@ class AdminApiFlowRun extends Model
'execution_log',
'input_variables',
'error_message',
'api_logs',
'executed_by',
];
@@ -67,6 +68,7 @@ class AdminApiFlowRun extends Model
'failed_step' => 'integer',
'execution_log' => 'array',
'input_variables' => 'array',
'api_logs' => 'array',
'executed_by' => 'integer',
];
@@ -171,4 +173,33 @@ public function getStatusColorAttribute(): string
default => 'bg-gray-100 text-gray-600',
};
}
/**
* API 로그 개수 반환
*/
public function getApiLogCountAttribute(): int
{
return is_array($this->api_logs) ? count($this->api_logs) : 0;
}
/**
* API 로그에 오류가 있는지 확인
*/
public function hasApiErrors(): bool
{
if (! is_array($this->api_logs)) {
return false;
}
foreach ($this->api_logs as $log) {
if (isset($log['type']) && $log['type'] === 'response') {
$status = $log['status'] ?? 0;
if ($status >= 400) {
return true;
}
}
}
return false;
}
}