File tree Expand file tree Collapse file tree 5 files changed +41
-7
lines changed
src/main/java/com/somemore/volunteer Expand file tree Collapse file tree 5 files changed +41
-7
lines changed Original file line number Diff line number Diff line change @@ -32,17 +32,28 @@ public ApiResponse<VolunteerProfileResponseDto> getMyProfile(
3232 @ UserId UUID userId ) {
3333 return ApiResponse .ok (
3434 200 ,
35- getVolunteerProfileUseCase .getProfile (userId ),
35+ getVolunteerProfileUseCase .getProfileByUserId (userId ),
3636 "본인 프로필 조회 성공" );
3737 }
3838
39- @ GetMapping ("/{volunteerId}" )
40- @ Operation (summary = "타인 프로필 조회" , description = "특정 봉사자의 상세 프로필을 조회합니다." )
41- public ApiResponse <VolunteerProfileResponseDto > getVolunteerProfile (
39+ @ GetMapping ("/user-id/{userId}" )
40+ @ Operation (summary = "타인 프로필 조회 (유저 아이디)" , description = "유저 아이디로 특정 봉사자의 상세 프로필을 조회합니다." )
41+ public ApiResponse <VolunteerProfileResponseDto > getVolunteerProfileByUserId (
42+ @ PathVariable UUID userId ) {
43+ return ApiResponse .ok (
44+ 200 ,
45+ getVolunteerProfileUseCase .getProfileByUserId (userId ),
46+ "타인 프로필 조회 성공"
47+ );
48+ }
49+
50+ @ GetMapping ("/volunteer-id/{volunteerId}" )
51+ @ Operation (summary = "타인 프로필 조회 (봉사자 아아디)" , description = "봉사자 아이디특정 봉사자의 상세 프로필을 조회합니다." )
52+ public ApiResponse <VolunteerProfileResponseDto > getVolunteerProfileByVolunteerId (
4253 @ PathVariable UUID volunteerId ) {
4354 return ApiResponse .ok (
4455 200 ,
45- getVolunteerProfileUseCase .getProfile (volunteerId ),
56+ getVolunteerProfileUseCase .getProfileByVolunteerId (volunteerId ),
4657 "타인 프로필 조회 성공"
4758 );
4859 }
Original file line number Diff line number Diff line change @@ -21,10 +21,16 @@ public class GetVolunteerProfileService implements GetVolunteerProfileUseCase {
2121 private final UserQueryUseCase userQueryUseCase ;
2222
2323 @ Override
24- public VolunteerProfileResponseDto getProfile (UUID userId ) {
24+ public VolunteerProfileResponseDto getProfileByUserId (UUID userId ) {
2525 NEWVolunteer volunteer = volunteerQueryUseCase .getByUserId (userId );
2626 UserCommonAttribute commonAttribute = userQueryUseCase .getCommonAttributeByUserId (userId );
2727
2828 return VolunteerProfileResponseDto .of (volunteer , commonAttribute );
2929 }
30+
31+ @ Override
32+ public VolunteerProfileResponseDto getProfileByVolunteerId (UUID volunteerId ) {
33+ UUID userId = volunteerQueryUseCase .getUserIdById (volunteerId );
34+ return getProfileByUserId (userId );
35+ }
3036}
Original file line number Diff line number Diff line change @@ -18,12 +18,23 @@ public class NEWVolunteerQueryService implements NEWVolunteerQueryUseCase {
1818
1919 private final NEWVolunteerRepository volunteerRepository ;
2020
21+ @ Override
22+ public NEWVolunteer getById (UUID id ) {
23+ return volunteerRepository .findById (id )
24+ .orElseThrow (() -> new NoSuchElementException (ExceptionMessage .NOT_EXISTS_VOLUNTEER ));
25+ }
26+
2127 @ Override
2228 public NEWVolunteer getByUserId (UUID userId ) {
2329 return volunteerRepository .findByUserId (userId )
2430 .orElseThrow (() -> new NoSuchElementException (ExceptionMessage .NOT_EXISTS_VOLUNTEER ));
2531 }
2632
33+ @ Override
34+ public UUID getUserIdById (UUID id ) {
35+ return getById (id ).getUserId ();
36+ }
37+
2738 @ Override
2839 public UUID getIdByUserId (UUID userId ) {
2940 return getByUserId (userId ).getId ();
Original file line number Diff line number Diff line change 66
77public interface GetVolunteerProfileUseCase {
88
9- VolunteerProfileResponseDto getProfile (UUID userId );
9+ VolunteerProfileResponseDto getProfileByUserId (UUID userId );
10+
11+ VolunteerProfileResponseDto getProfileByVolunteerId (UUID volunteerId );
1012}
Original file line number Diff line number Diff line change 66
77public interface NEWVolunteerQueryUseCase {
88
9+ NEWVolunteer getById (UUID id );
10+
911 NEWVolunteer getByUserId (UUID userId );
1012
13+ UUID getUserIdById (UUID id );
14+
1115 UUID getIdByUserId (UUID userId );
1216}
You can’t perform that action at this time.
0 commit comments