File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
src/main/java/com/example/log4u/domain/user Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -90,13 +90,13 @@ public ResponseEntity<UserProfileResponseDto> getMyProfile(
9090 return ResponseEntity .ok (userProfileResponseDto );
9191 }
9292
93- @ GetMapping ("/{nickname }" )
93+ @ GetMapping ("/{id }" )
9494 public ResponseEntity <UserProfileResponseDto > getUserProfile (
9595 @ AuthenticationPrincipal CustomOAuth2User customOAuth2User ,
96- @ PathVariable String nickname
96+ @ PathVariable Long id
9797 ) {
9898 UserProfileResponseDto userProfileResponseDto =
99- userService .getUserProfile ( nickname );
99+ userService .getUserProfileById ( id );
100100 return ResponseEntity .ok (userProfileResponseDto );
101101 }
102102
Original file line number Diff line number Diff line change @@ -38,14 +38,13 @@ public UserProfileResponseDto getMyProfile(Long userId) {
3838 );
3939 }
4040
41- public UserProfileResponseDto getUserProfile (String nickname ) {
42- User target = getUserByNickname (nickname );
43- final Long targetId = target .getUserId ();
41+ public UserProfileResponseDto getUserProfileById (Long id ) {
42+ User target = getUserById (id );
4443
4544 return UserProfileResponseDto .fromUser (
4645 target ,
47- followRepository .countByTargetId (targetId ),
48- followRepository .countByInitiatorId (targetId )
46+ followRepository .countByTargetId (id ),
47+ followRepository .countByInitiatorId (id )
4948 );
5049 }
5150
You can’t perform that action at this time.
0 commit comments