개발 환경 🍃 Spring : Spring Boot 2.7.7 + Spring Security 🛠️ Java : Amazon corretto 17 설명하기 앞서 해당 포스트는 개발 과정을 기록하기 위한 글입니다. 필요한 부분은 본인 프로젝트에 맞춰서 수정해주시면 감사하겠습니다! Spring Scheduler란? 스프링에서 제공하는 스케쥴링 기능으로, 원하는 주기로 작업을 실행하거나, 특정 시간에 작업을 실행하도록 설정할 수 있다. 프로젝트 적용 Opinet을 통해 하루 평균 유가 정보를 주기적으로 받아오기 위해 사용 Application Setting 프로젝트 어플리케이션 클래스단에 @EnableScheduling 어노테이션을 추가해준다. 또한, 로컬에서는 잘 작동할 수 있지만, 배포 환경에서는 다를 수..
개발 환경 🍃 Spring : Spring Boot 2.7.7 + Spring Security 🛠️ Java : Amazon corretto 17 설명하기 앞서 해당 포스트는 개발 과정을 기록하기 위한 글입니다. 필요한 부분은 본인 프로젝트에 맞춰서 수정해주시면 감사하겠습니다! Spring AOP란? AOP(Aspect Oriented Programming)는 흩어진 관심사를 모듈화할 수 있는 프로그래밍 기법 중 하나이다. 예시로 Member, Post, Reply라는 Entity가 존재한다고 가정하자. Class A : MemberController Class B : PostController Class C : ReplyController 빨간색 블럭 : @GetMapping 주황색 블럭 : @Post..
oEmbed란? 공식문서 oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly. oEmbed는 서드파티 사이트에서 URL을 삽입하여 표시할 수 있는 형식입니다.심플한 API를 사용하면 웹 사이트에서 해당 리소스에 대한 링크를 게시할 때 리소스를 직접 구문 분석할 필요 없이 내장된 콘텐츠(사..
💨 요청 흐름 JS로 현재 위도, 경도 받아오기 받아온 값을 BackEnd 서버로 전달 Kakao Maps Api에 요청 보내기 도로명 주소 출력하기 🗺️ 현재 위도, 경도 받아오기 JavaScript에서 제공해주는 기능 중 geolocation을 사용 geolocation 우선 geolocation의 함수 모양부터 살펴보자! navigator.geolocation.getCurrentPosition(successFn, failedFn); function successFn(position) { // 위도 const lat = position.coords.latitude; // 경도 const lng = position.coords.longitude; // 사용자 정의 } function failedFn(p..
💭 Opiotnal이란? Spring 예시 코드를 통해 간단하게 이해해보자! public class PostController{ @GetMapping("/post/{id}") public String postDetail(@PathVariable long id, Model model) { Post currentPost = postService.findPostById(id); model.addAttribute("post", currentPost); return "post/detail"; } } public class PostService{ public Post findPostById(long id) { // findById의 반환타입이 Post라고 가정 return postRepository.findById..
Model Mapper Entity를 DTO로 혹은 DTO를 Entity로 변환하기 위해 사용한다. (Entity 🔄 DTO) ⚙️ Setting # build.gradle dependencies { implementation 'org.modelmapper:modelmapper:3.1.1' } @Configuration public class AppConfig { @Bean public ModelMapper modelMapper() { return new ModelMapper(); } } 🛠 Entity & DTO @Entity @SuperBuilder @Getter @Setter ... public class Post extends BaseEntity { private String title; priv..