File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/main/java/com/back/domain/profile/controller Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11package com .back .domain .profile .controller ;
22
33import com .back .domain .profile .dto .ProfileResponseDto ;
4+ import com .back .domain .profile .dto .ProfileUpdateRequestDto ;
45import com .back .domain .profile .service .ProfileService ;
56import com .back .domain .user .service .UserService ;
67import com .back .global .rsData .RsData ;
8+ import jakarta .validation .Valid ;
79import lombok .RequiredArgsConstructor ;
810import 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 ;
11+ import org .springframework .web .bind .annotation .*;
1212
1313@ RestController
1414@ RequestMapping ("/me/profile" )
@@ -23,4 +23,10 @@ public RsData<ProfileResponseDto> getProfile(@AuthenticationPrincipal(expression
2323 ProfileResponseDto body = profileService .getProfile (userId );
2424 return RsData .successOf (body ); // code=200, message="success"
2525 }
26+
27+ @ PutMapping
28+ public RsData <ProfileResponseDto > updateProfile (@ AuthenticationPrincipal (expression = "id" ) Long userId , @ Valid @ RequestBody ProfileUpdateRequestDto profileUpdateRequestDto ) {
29+ ProfileResponseDto body = profileService .updateProfile (userId , profileUpdateRequestDto );
30+ return RsData .successOf (body ); // code=200
31+ }
2632}
You can’t perform that action at this time.
0 commit comments