@@ -182,4 +182,69 @@ public APIResponse<?> validateNickname(@RequestParam String nickname) {
182182 userService .validateNickname (nickname );
183183 return success ();
184184 }
185+
186+ @ Operation (
187+ summary = "프로필 이미지 변경" ,
188+ description = "사용자의 프로필 이미지를 변경합니다. 이미지 URL을 전달받아 업데이트합니다."
189+ )
190+ @ ApiResponses ({
191+ @ ApiResponse (
192+ responseCode = "200" ,
193+ description = "프로필 이미지 변경 성공"
194+ ),
195+ @ ApiResponse (
196+ responseCode = "400" ,
197+ description = "잘못된 요청 (유효하지 않은 이미지 URL)" ,
198+ content = @ Content (schema = @ Schema (implementation = ErrorResponse .class ))
199+ ),
200+ @ ApiResponse (
201+ responseCode = "401" ,
202+ description = "인증 실패" ,
203+ content = @ Content (schema = @ Schema (implementation = ErrorResponse .class ))
204+ ),
205+ @ ApiResponse (
206+ responseCode = "404" ,
207+ description = "사용자를 찾을 수 없음" ,
208+ content = @ Content (schema = @ Schema (implementation = ErrorResponse .class ))
209+ )
210+ })
211+ @ PutMapping ("/profile-image" )
212+ public ResponseEntity <Void > updateProfileImage (
213+ @ Parameter (description = "변경할 프로필 이미지 URL" , required = true , example = "https://example.com/image.jpg" )
214+ @ RequestParam ("image" ) String image ,
215+ @ Parameter (hidden = true )
216+ @ AuthenticationPrincipal Long userId ) {
217+
218+ userService .updateProfileImage (userId , image );
219+ return ResponseEntity .ok ().build ();
220+ }
221+
222+ @ Operation (
223+ summary = "프로필 이미지 삭제" ,
224+ description = "사용자의 프로필 이미지를 삭제하고 기본 이미지로 변경합니다."
225+ )
226+ @ ApiResponses ({
227+ @ ApiResponse (
228+ responseCode = "200" ,
229+ description = "프로필 이미지 삭제 성공 (기본 이미지로 변경됨)"
230+ ),
231+ @ ApiResponse (
232+ responseCode = "401" ,
233+ description = "인증 실패" ,
234+ content = @ Content (schema = @ Schema (implementation = ErrorResponse .class ))
235+ ),
236+ @ ApiResponse (
237+ responseCode = "404" ,
238+ description = "사용자를 찾을 수 없음" ,
239+ content = @ Content (schema = @ Schema (implementation = ErrorResponse .class ))
240+ )
241+ })
242+ @ DeleteMapping ("/profile-image" )
243+ public ResponseEntity <Void > deleteProfileImage (
244+ @ Parameter (hidden = true )
245+ @ AuthenticationPrincipal Long userId ) {
246+
247+ userService .deleteProfileImage (userId );
248+ return ResponseEntity .ok ().build ();
249+ }
185250}
0 commit comments