Skip to content

Commit

Permalink
S3데이터 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
SeWooooong committed Aug 22, 2024
1 parent 786d51c commit a38b0d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -124,4 +117,9 @@ public ResponseEntity<String> deleteProfileImage(@CurrentMember Member member) {
return new ResponseEntity<>(memberService.deleteProfileImage(member), HttpStatus.OK);
}

@PostMapping("/member/s3/file")
public ResponseEntity<String> deleteS3File(@RequestParam String imageUrl) {
return new ResponseEntity<>(memberService.deleteFile(imageUrl), HttpStatus.OK);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,10 @@ public String uploadFile(Member member, MultipartFile multipartFile) throws IOEx
}
return null;
}

public String deleteFile(String imageUrl) {
s3Service.deleteFile(imageUrl);

return "삭제 완료";
}
}

0 comments on commit a38b0d7

Please sign in to comment.