File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
src/main/java/com/back/domain/profile/controller Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .back .domain .profile .controller ;
2+
3+ import com .back .domain .profile .dto .ProfileResponseDto ;
4+ import com .back .domain .profile .service .ProfileService ;
5+ import com .back .domain .user .service .UserService ;
6+ import com .back .global .rsData .RsData ;
7+ import lombok .RequiredArgsConstructor ;
8+ import org .springframework .security .core .annotation .AuthenticationPrincipal ;
9+ import org .springframework .web .bind .annotation .GetMapping ;
10+ import org .springframework .web .bind .annotation .RequestMapping ;
11+ import org .springframework .web .bind .annotation .RestController ;
12+
13+ @ RestController
14+ @ RequestMapping ("/me/profile" )
15+ @ RequiredArgsConstructor
16+ public class ProfileController {
17+
18+ private final UserService userService ;
19+ private final ProfileService profileService ;
20+
21+ @ GetMapping
22+ public RsData <ProfileResponseDto > getProfile (@ AuthenticationPrincipal (expression = "id" ) Long userId ) {
23+ ProfileResponseDto body = profileService .getProfile (userId );
24+ return RsData .successOf (body ); // code=200, message="success"
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments