[admin] datagsm 프로젝트 등록 시 SDK base-url 누락 및 응답 래퍼 미해제 버그 수정#93
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a generic response wrapper, DatagsmApiResponse, to handle standard response formats from the DataGSM OpenAPI. The DatagsmApiClient and AdminApproveProjectService have been updated to utilize this wrapper when creating projects. The review feedback suggests improving error handling in AdminApproveProjectService by extracting and including the specific error message from the API response (response.getMessage()) in the thrown exception to facilitate better debugging.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
개요
프로젝트 승인(
PATCH /api/v2/admin/approve/{id}) 시 datagsm 연동에서 발생하던 두 가지 버그를 수정합니다. base-url 미지정으로 SDK가 운영 서버를 호출해 401이 발생하던 문제와, 생성 응답의data래퍼를 풀지 못해 id 추출에 실패하던 문제를 함께 해결합니다.작업 내용
DataGsmOpenApiConfig:DataGsmOpenApiClient.builder(apiKey)에baseUrl을 명시하도록 수정. 미지정 시 SDK 기본값(운영openapi.datagsm.kr)으로 호출되어, stage 환경에서 stage 키로 운영 서버를 치며유효하지 않은 API Key401이 발생하던 문제를 해결DatagsmApiResponse<T>공통 응답 래퍼 DTO 추가 (status/code/message/data) — datagsm OpenAPI가 모든 응답을data로 감싸는 구조에 대응DatagsmApiClient.createProject반환 타입을DatagsmApiResponse<DatagsmProjectResDto>로 변경AdminApproveProjectService.registerToDatagsm에서response.getData().getId()로 id를 추출하도록 수정 — 기존에는 최상위에서 id를 찾아 항상 null이 되어 "응답에 id가 없습니다" 예외가 발생체크리스트
기타
application-*.yml변경은 포함하지 않았습니다. stage/prod의spring.cloud.datagsm.openapi.base-url프로퍼티(끝 슬래시 없는 stage/prod OpenAPI 주소)는 별도로 Secret에 추가가 필요합니다.getClubs/getStudents의 Feign DTO도 동일하게data래퍼를 풀지 않고 있어, 해당 응답이 래퍼 구조라면 잠재 버그가 남아 있습니다. SDK에 이미 조회 메서드가 존재하므로 후속 PR에서 Feign → SDK 전환으로 정리하는 것을 권장합니다.