File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/main/java/com/drinkeg/drinkeg/domain/member Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 10
10
import io .swagger .v3 .oas .annotations .tags .Tag ;
11
11
import io .swagger .v3 .oas .annotations .Operation ;
12
12
import jakarta .servlet .http .HttpServletResponse ;
13
- import jakarta .validation .Valid ;
14
13
import lombok .RequiredArgsConstructor ;
15
14
import org .springframework .security .core .annotation .AuthenticationPrincipal ;
16
15
import org .springframework .web .bind .annotation .*;
@@ -79,4 +78,11 @@ public ApiResponse<UsernameCheckResponse> checkUsername(@RequestBody UsernameChe
79
78
UsernameCheckResponse usernameCheckResponse = joinService .isDuplicatedUsername (usernameCheckRequest );
80
79
return ApiResponse .onSuccess (usernameCheckResponse );
81
80
}
81
+
82
+ @ PostMapping ("/member/profileImage" )
83
+ @ Operation (summary = "프로필 이미지 업로드" , description = "프로필 이미지를 업로드합니다." )
84
+ public ApiResponse <?> uploadProfileImage (@ RequestPart ("profileImg" ) MultipartFile profileImg , @ AuthenticationPrincipal PrincipalDetail principalDetail ) {
85
+ joinService .uploadProfileImage (profileImg , principalDetail .getUsername ());
86
+ return ApiResponse .onSuccess ("프로필 이미지 업로드 성공" );
87
+ }
82
88
}
Original file line number Diff line number Diff line change @@ -86,4 +86,10 @@ public UsernameCheckResponse isDuplicatedUsername(UsernameCheckRequest usernameC
86
86
87
87
return new UsernameCheckResponse (memberRepository .existsByUsername (usernameCheckRequest .username ()));
88
88
}
89
+
90
+ public void uploadProfileImage (MultipartFile profileImg , String username ) {
91
+ // 이미지 업로드
92
+ // 멤버 프로필 이미지 변경
93
+ // 기존 이미지 삭제
94
+ }
89
95
}
You can’t perform that action at this time.
0 commit comments