Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ private Users findUserById(Integer userNumber) {
public void updateUserTravelDistance(Integer userNumber, double travelDistance) {
Users user = userRepository.findById(userNumber)
.orElseThrow(() -> new RuntimeException("사용자 없음"));
user.setTotalDistance(travelDistance); // 누적 저장
double roundedDistance = Math.round(travelDistance * 100.0) / 100.0;

user.setTotalDistance(roundedDistance); // 누적 저장
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,7 @@ public ApiResponse<ProfileViewResponse> viewProfile(
throw new MoingApplicationException("사용자를 찾을 수 없음");
}

// 실제 계산 로직이 없으므로, 0 또는 기본값으로 설정
double travelDistance = 0.0;
int visitedCountryCount = 0;
int travelBadgeCount = 0;

// DTO 생성자에 맞춰서 값 전달
ProfileViewResponse response = new ProfileViewResponse(
userOpt.get(),
visitedCountryCount,
travelBadgeCount
);
ProfileViewResponse response = profileService.getProfileView(userNumber);

return ApiResponse.success(response);
} catch (IllegalArgumentException e) {
Expand Down