From a38b0d7b3247fd6a93b925e75b98b8a9f78c66ea Mon Sep 17 00:00:00 2001 From: SewoongPark Date: Thu, 22 Aug 2024 22:37:14 +0900 Subject: [PATCH] =?UTF-8?q?S3=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/member/MemberController.java | 14 ++++++-------- .../domain/member/MemberService.java | 6 ++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/example/mssaembackendv2/domain/member/MemberController.java b/src/main/java/com/example/mssaembackendv2/domain/member/MemberController.java index 4b14f24..caf4806 100644 --- a/src/main/java/com/example/mssaembackendv2/domain/member/MemberController.java +++ b/src/main/java/com/example/mssaembackendv2/domain/member/MemberController.java @@ -18,14 +18,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PatchMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @RequiredArgsConstructor @@ -124,4 +117,9 @@ public ResponseEntity deleteProfileImage(@CurrentMember Member member) { return new ResponseEntity<>(memberService.deleteProfileImage(member), HttpStatus.OK); } + @PostMapping("/member/s3/file") + public ResponseEntity deleteS3File(@RequestParam String imageUrl) { + return new ResponseEntity<>(memberService.deleteFile(imageUrl), HttpStatus.OK); + } + } diff --git a/src/main/java/com/example/mssaembackendv2/domain/member/MemberService.java b/src/main/java/com/example/mssaembackendv2/domain/member/MemberService.java index 5a39583..7efb915 100644 --- a/src/main/java/com/example/mssaembackendv2/domain/member/MemberService.java +++ b/src/main/java/com/example/mssaembackendv2/domain/member/MemberService.java @@ -210,4 +210,10 @@ public String uploadFile(Member member, MultipartFile multipartFile) throws IOEx } return null; } + + public String deleteFile(String imageUrl) { + s3Service.deleteFile(imageUrl); + + return "삭제 완료"; + } }