BackEnd/SpringBoot

0.MySQL 설치공식 사이트에서 MySQL을 설치한다.https://downloads.mysql.com/archives/installer/ MySQL :: Download MySQL Installer (Archived Versions)Please note that these are old versions. New releases will have recent bug fixes and features! To download the latest release of MySQL Installer, please visit MySQL Downloads. MySQL open source software is provided under the GPL License.downloads.mysql.com 1.appli..
1.N+1 문제하나의 쿼리(1)로 엔티티 리스트를 조회한 후, 연관된 엔티티들을 조회할 때 각각의 건마다 추가 쿼리(N개)가 발생하는 현상 만약 다음 처럼 회원과 주문 엔티티가 있을때@Entitypublic class Member { @Id @GeneratedValue private Long id; private String name; @OneToMany(mappedBy = "member") private List orders;}@Entitypublic class Order { @Id @GeneratedValue private Long id; private String itemName; @ManyToOne(fetch = FetchType.LAZY)..
1. gradle 다운우선 최신버전 gradle을 다운받은 다음에 환경변수 설정을 해준다.https://gradle.org/releases/ Gradle | ReleasesFind binaries and reference documentation for current and past versions of Gradle.gradle.org 2. 변환하기프로젝트 루트 폴더에서 gradle init 명령어를 실행해준다. gradle init 프로젝트(maven) 을 gradle로 수정하기 위해 yes를 고른다.Found existing files in the project directory: 'C:\Windows\System32\WindowsPowerShell\v1.0'.Directory will b..
1.Filter인증, 인가, 로깅, CORS 처리와 같은 공통 작업을 처리한다 다음코드는 CORS 설정, CSRF 공격방지, JWT 토큰검증, OAuth 로그인 처리, 보안헤더 설정이 Filter 단계에 포함된다.@BeanSecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http .cors(cors -> cors.configurationSource(corsConfigurationSource())) .authorizeHttpRequests(auth -> auth .requestMatchers("/") .p..
1.thumbnailator 의존성추가자바에서 이미지 리사이징을 매우 간단하고 효율적으로 처리할 수 있게 도와주는 오픈소스 라이브러리를 추가해준다. net.coobird thumbnailator 0.4.14 2.이미지 리사이징Thumbnails를 사용하여 높이는 자동으로 하고 너비는 800px로 리사이징하는 코드를 쉽게 만들수있다.// 리사이징 처리 너비 800pxThumbnails.of(originalImage) .size(800, Integer.MAX_VALUE) .outputFormat(extension) .toFile(new File(filePath)); public class ImageUploadService { private static ..
0.발단시험기간이 끝나고 오랜만에 vscode에서 springboot 프로젝트를 실행하니 다음과 같은 오류 메시지가 나왔다.최근 이 프로젝트를 안하고 인텔리제이에서 gradle로 작업해서 내 환경설정이 바뀐문제인줄 알고 찾았지만 아니였다.Can't initialize javac processor due to (most likely) a class loader problem: java.lang.NoClassDefFoundError: Could not initialize class lombok.javac.Javac 1. lombok 이슈 해결lombok 깃헙을 확인해본결과 나랑 동일한 이슈를 겪는 글을 발견하였다.https://github.com/projectlombok/lombok/issues/3871?..
1. WebFlux 의존성 추가WebClient 같은 비동기 HTTP 클라이언트를 사용하기 위해 다음 의존성을 추가해줬다. org.springframework.boot spring-boot-starter-webflux 2. WebClient 빈 추가WebConfig 파일에 WebClient.Builder builder를 통해 스프링이 미리 준비해둔 빌더로 기본 설정 상태의 WebClient를 Bean으로 등록해둔다.@Beanpublic WebClient webClient(WebClient.Builder builder) { return builder.build();} 3.외부API 받아오기WebClient를 사용하여 GET 방식으로 외부 url에 요청을 보내고 retriev..
1.의존성추가OAuth 2.0 및 OpenID Connect 기반의 로그인 기능을 쉽게 구현할수 있게해주는 의존성을 추가해준다. org.springframework.boot spring-boot-starter-oauth2-client  2. 구글 OAuth등록하기2-1.프로젝트 생성우선 아래 링크로 들어가서 새프로젝트를 생성하자https://console.cloud.google.com/    2-2. OAuth 클라이언트 ID만들기 API 및 서비스 -> 사용자 인증정보로 들어간다. 사용자 인증 정보 만들기 -> OAuth 클라이언트 ID를 선택한다.   우선 동의화면을 구성하라고 하니 들어가서 하라는것들을 완료한다.      이제 OAuth 클라이언트 만들기를 선택한다.   어플리케이션 유형..
박종범_
'BackEnd/SpringBoot' 카테고리의 글 목록 (3 Page)