11package com .example .solidconnection .mentor .controller ;
22
33import com .example .solidconnection .common .resolver .AuthorizedUser ;
4+ import com .example .solidconnection .mentor .dto .MentorMyPageUpdateRequest ;
45import com .example .solidconnection .mentor .dto .MentorMyPageResponse ;
56import com .example .solidconnection .mentor .service .MentorMyPageService ;
67import com .example .solidconnection .security .annotation .RequireRoleAccess ;
78import com .example .solidconnection .siteuser .domain .Role ;
89import com .example .solidconnection .siteuser .domain .SiteUser ;
10+ import jakarta .validation .Valid ;
911import lombok .RequiredArgsConstructor ;
1012import org .springframework .http .ResponseEntity ;
1113import org .springframework .web .bind .annotation .GetMapping ;
14+ import org .springframework .web .bind .annotation .PutMapping ;
1215import org .springframework .web .bind .annotation .RequestMapping ;
16+ import org .springframework .web .bind .annotation .RequestParam ;
1317import org .springframework .web .bind .annotation .RestController ;
18+ import org .springframework .web .multipart .MultipartFile ;
1419
1520@ RequiredArgsConstructor
1621@ RequestMapping ("/mentor/my" )
@@ -27,4 +32,15 @@ public ResponseEntity<MentorMyPageResponse> getMentorMyPage(
2732 MentorMyPageResponse mentorMyPageResponse = mentorMyPageService .getMentorMyPage (siteUser );
2833 return ResponseEntity .ok (mentorMyPageResponse );
2934 }
35+
36+ @ RequireRoleAccess (roles = {Role .MENTOR })
37+ @ PutMapping
38+ public ResponseEntity <String > updateMentorMyPage (
39+ @ AuthorizedUser SiteUser siteUser ,
40+ @ Valid MentorMyPageUpdateRequest mentorMyPageUpdateRequest ,
41+ @ RequestParam (value = "file" , required = false ) MultipartFile imageFile
42+ ) {
43+ mentorMyPageService .updateMentorMyPage (siteUser , mentorMyPageUpdateRequest , imageFile );
44+ return ResponseEntity .ok ().build ();
45+ }
3046}
0 commit comments