2323import lombok .RequiredArgsConstructor ;
2424import org .springframework .data .domain .Page ;
2525import org .springframework .http .HttpStatus ;
26+ import org .springframework .http .MediaType ;
2627import org .springframework .http .ResponseEntity ;
2728import org .springframework .security .access .prepost .PreAuthorize ;
2829import org .springframework .security .core .annotation .AuthenticationPrincipal ;
@@ -87,7 +88,7 @@ public class FundingController {
8788 .body (new RsData <>("201" , "펀딩이 생성되었습니다." , response ));
8889 }
8990
90- @ PostMapping ("/images" )
91+ @ PostMapping (value = "/images" , consumes = MediaType . MULTIPART_FORM_DATA_VALUE )
9192 @ PreAuthorize ("hasAuthority('ROLE_ARTIST') or hasAuthority('ROLE_ADMIN') or hasAuthority('ROLE_ROOT')" )
9293 @ Operation (
9394 summary = "펀딩 이미지 업로드" ,
@@ -96,7 +97,6 @@ public class FundingController {
9697 "types -> 업로드할 파일 타입. 대표 이미지(MAIN), 추가 이미지(ADDITIONAL), 썸네일(THUMBNAIL), 문서(DOCUMENT)"
9798 ) public ResponseEntity <RsData <List <UploadResultResponse >>> uploadFundingImages (
9899 @ RequestPart List <MultipartFile > files ,
99- @ Parameter (hidden = true )
100100 @ RequestParam List <FileType > types ) {
101101 List <UploadResultResponse > uploaded = s3Service .uploadFiles (files , "funding-images" , types );
102102 return ResponseEntity .ok (RsData .of ("200" , "이미지 업로드 성공" , uploaded ));
0 commit comments