본문 바로가기

spring-boot3

Spring-boot & AWS S3 연동 이미지 업로드 - (2) https://kjy154969.tistory.com/48 - Spring-boot & AWS S3 연동 이미지 업로드 - (1) Spring-boot & AWS S3 연동 이미지 업로드 - (1)S3 란?AWS(아마존 웹 서비스)가 제공하는 클라우드 스토리지 서비스이다. 다양한 유형의 미디어(파일, 데이터 등)를 저장하고 관리하는데 사용되는 웹 기반 스토리지 시스템이다. 저장하는 데이터kjy154969.tistory.com 이전 글에서는 AWS S3 버킷 생성 후 정책 설정까지 완료하였다. 이번에는 스프링 부트와 연동을 해보도록 하자. AWS cloud와 연동시켜서 S3를 사용하기 위해 build.gradle 파일에 해당 코드를 입력해준다.implementation 'org.springframework.. 2024. 4. 28.
SpringBoot 축구 팀 CRUD 초초초미니 프로젝트 - 축구팀 삭제기능 구현 삭제도 쉽다! 파라미터 id 값을 받아 서비스에게 넘겨준다. @DeleteMapping("/api/soccer-team/{id}") public ResponseEntity deleteSoccerTeam(@PathVariable Long id){ Team deleted = soccerteamService.deleteSoccerTeam(id); //삭제가 잘 되었는가? return (deleted != null) ? ResponseEntity.status(HttpStatus.NO_CONTENT).build(): ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null); } 서비스에서 deleteSoccerTeam 메서드를 만들어 삭제 기능 구현을 한다. socce.. 2024. 4. 22.
SpringBoot 축구 팀 CRUD 초초초미니 프로젝트 - 축구팀 수정 구현 그동안의 기능을 구현한 과정을 보면 자세한 부분에 있어서는 이제는 이해가 될 것이다. 컨트롤러 id 값과 받은 정보를 받은 dto를 soccerteamService 로 보내주고 해당 서비스에서 요리(데이터 처리)를 해주면 된다. @PatchMapping("/api/soccer-team/{id}") public ResponseEntity createSoccer(@PathVariable Long id, @RequestBody SoccerteamDto dto){ Team updated = soccerteamService.updateSoccerTeam(id, dto); //수정이 잘 되었는가? return (updated != null) ? ResponseEntity.status(HttpStatus.OK).bo.. 2024. 4. 22.