Skip to content

Commit

Permalink
refactor(service): 불필요한 코드 제거 및 변수명 변경
Browse files Browse the repository at this point in the history
- `findVolunteer`와 `findVolunteerDetail` 메서드 제거
  - 사용되지 않는 메서드로 판단하여 삭제
- `NEWVolunteerRepository` 변수명을 `volunteerRepository`로 변경
  - 가독성 및 네이밍 일관성 강화
  • Loading branch information
m-a-king committed Jan 23, 2025
1 parent e3f03f1 commit cb679a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.somemore.domains.volunteer.service;

import com.somemore.domains.volunteer.domain.Volunteer;
import com.somemore.domains.volunteer.domain.VolunteerDetail;
import com.somemore.domains.volunteer.dto.response.VolunteerRankingResponseDto;
import com.somemore.domains.volunteer.repository.VolunteerDetailRepository;
import com.somemore.domains.volunteer.repository.VolunteerRepository;
Expand Down Expand Up @@ -70,15 +69,4 @@ public void validateVolunteerExists(UUID volunteerId) {
throw new BadRequestException(NOT_EXISTS_VOLUNTEER.getMessage());
}
}

private Volunteer findVolunteer(UUID volunteerId) {
return volunteerRepository.findById(volunteerId)
.orElseThrow(() -> new BadRequestException(NOT_EXISTS_VOLUNTEER));
}

private VolunteerDetail findVolunteerDetail(UUID volunteerId) {
return volunteerDetailRepository.findByVolunteerId(volunteerId)
.orElseThrow(() -> new BadRequestException(NOT_EXISTS_VOLUNTEER));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
@Transactional
public class RegisterNEWVolunteerService implements NEWRegisterVolunteerUseCase {

private final NEWVolunteerRepository NEWVolunteerRepository;
private final NEWVolunteerRepository volunteerRepository;

@Override
public void register(UUID userId) {
NEWVolunteer volunteer = NEWVolunteer.createDefault(userId);

NEWVolunteerRepository.save(volunteer);
volunteerRepository.save(volunteer);
}
}

0 comments on commit cb679a7

Please sign in to comment.