15주차: QA 및 버그 수정 - Yongsu01/HSP GitHub Wiki
- 프로필 업로드, 히스토리 & 골격근량/체지방률 연동 완료
profileTest.mp4
-
GET http://[주소]:8080/body-image → 최근 이미지 응답 확인
-
GET http://[주소]:8080/body-image/history → 전체 히스토리
-
POST http://[주소]:8080/body-image → 이미지 업로드


- 캘린더 연동 완료
calendarTest.mp4
-
병렬 API 테스트용 스크립트 작성 및 실행
→ 실제 사용자 2명의 Access Token을 이용해 여러 개의 API를 병렬로 호출
💻 병렬 API 요청 스크립트 보기
const address = "";
// 사용자별 Access Token
const users = [
{
name: "User1",
token: "Bearer "
},
{
name: "User2",
token: "Bearer "
}
];
Promise.all(
users.map(user =>
new Promise(resolve => {
const requests = [
{
name: "getProfile",
method: "POST",
url: `${address}/user/profile`,
body: {
"height": 190,
"gender": "M",
"role": "MEMBER"
}
},
{
name: "getBodyImage",
method: "GET",
url: `${address}/body-image`
},
{
name: "getPhysicalInfo",
method: "GET",
url: `${address}/physical-infos`
},
{
name: "getCalendar",
method: "GET",
url: `${address}/api/workout/calendar/full?year=2025&month=5`
},
{
name: "recommendWorkouts",
method: "POST",
url: `${address}/workout/recommendations`,
body: {
workoutCategoryList: ["CHEST", "BACK", "SHOULDER", "ARM", "LOWER_PART"]
}
},
{
name: "saveWorkoutLog",
method: "POST",
url: `${address}/api/workout-detail-logs`,
body: {
workoutList: [
{ workoutName: "EZ_BAR_FRONT_RAISE", weight: 10, numOfSet: 3, repsPerSet: 12 },
{ workoutName: "ARNOLD_PRESS", weight: 10, numOfSet: 3, repsPerSet: 12 }
]
}
},
{
name: "getBodyImageHistory",
method: "GET",
url: `${address}/body-image/history`
},
{
name: "getMuscleBodyFatHistory",
method: "GET",
url: `${address}/physical-infos/muscle-bodyfat?startDate=2025-04-15&endDate=2025-05-20`
}
];
// 사용자별 모든 API 병렬 요청
Promise.all(
requests.map(r =>
new Promise(innerResolve => {
const req = {
url: r.url,
method: r.method,
header: [{ key: "Authorization", value: user.token }]
};
if (r.method === "POST" || r.method === "PUT") {
req.header.push({ key: "Content-Type", value: "application/json" });
req.body = {
mode: "raw",
raw: JSON.stringify(r.body)
};
}
pm.sendRequest(req, (err2, res2) => {
if (err2) {
console.log(`${user.name} → ${r.name} 에러:`, err2);
} else {
try {
console.log(`${user.name} → ${r.name} 응답 [${res2.code}]:`, res2.json());
} catch (e) {
console.log(`${user.name} → ${r.name} 응답 [${res2.code}] (non-JSON):`, res2.text());
}
}
innerResolve();
});
})
)
).then(() => {
console.log(`✅ ${user.name}의 모든 API 요청 완료`);
resolve();
});
})
)
).then(() => {
console.log("🌐 모든 사용자 병렬 API 호출 완료");
});
-
병렬 요청 테스트 결과 (모든 요청 200 응답)
-
사용자의 메인 프로필 이미지를 불러올 때, 이미지가 저장되지 않은 경우
null
을 반환하지 않아 에러가 발생하는 문제 확인→ 이미지가 없는 경우에는 기본 이미지 경로를 반환하도록 백엔드 로직 수정 완료
- 최종 발표 자료 제작