Server/Spring boot

Server/Spring boot

Facade Pattern(퍼사드 패턴) 도입기

[트러블 슈팅] 스프링 순환 참조(spring circular reference) 해결하기 [트러블 슈팅] 스프링 순환 참조(spring circular reference) 해결하기 🚫 개요 개발하다가 다음과 같은 에러를 마주쳤다. *************************** APPLICATION FAILED TO START *************************** Description: The dependencies of some of the beans in the application context form a cycle: commentCont zer0silver.tistory.com 위 문제를 해결할 수 있는 또다른 방법을 알게되어 글을 작성해보려 한다. 1️⃣ 퍼사드 패턴이란 ? 퍼..

Server/Spring boot

[트러블 슈팅] 스프링 순환 참조(spring circular reference) 해결하기

🚫 개요 개발하다가 다음과 같은 에러를 마주쳤다. *************************** APPLICATION FAILED TO START *************************** Description: The dependencies of some of the beans in the application context form a cycle: commentController defined in file [/Users/youngeun/Desktop/Owori-Server/build/classes/java/main/com/owori/domain/comment/controller/CommentController.class] ↓ commentService defined in file [/Us..

Server/Spring boot

[Spring boot] 이미지를 포함하는 글 작성 API 설계 방식

개인적인 생각을 작성한 글입니다. 잘못된 점이나 부족한 부분이 있다면 언제든 지적 부탁드립니다 지금 진행 중인 프로젝트에서 글 작성 api 를 담당하게 되었다. 글 작성 화면은 아래와 같다. 기존에 내가 작성한 게시글 작성 api에서는 게시글에 필요한 정보 와 이미지 리스트 를 한번에 가져와 서비스에서 처리하도록 되어있었다. @PostMapping public ResponseEntity addStory(@RequestPart AddStoryRequest request, @RequestPart(required = false) List images){ return ResponseEntity.status(HttpStatus.CREATED).body(storyService.addStory(request, ima..

Server/Spring boot

[Spring boot] Google 로그인 유저 정보 가져오기

[Spring boot] security + Oauth2로 구글 로그인 구현하기 new RestApiException(ErrorCode.NO_LOGIN_USER)); } } OAuth 로그인 회원 정보를 가져오는 util class를 작성해보았습니다. getGoogleLoginMember() : 현재 인증된 사용자의 OAuth2AuthenticationToken을 가져와 사용자의 이메일을 추출합니다. 그리고 email을 통해 DB에서 해당 member를 반환하고, member가 존재하지 않는다면 예외를 발생하도록 합니다. 💰 OAuthLoginMemberUtiil 사용법 @RequiredArgsConstructor @RestController public class PostController { priv..

Server/Spring boot

[Spring boot] security + Oauth2로 구글 로그인 구현하기

build.gradle에 security 의존성 추가 //spring security implementation("org.springframework.boot:spring-boot-starter-security") implementation("org.springframework.security:spring-security-test") //spring security oauth2 implementation ("org.springframework.boot:spring-boot-starter-oauth2-client") implementation ("org.springframework.security:spring-security-oauth2-jose") Member Entity 💰 MemberRole @Get..

Server/Spring boot

[Spring boot] security + Oauth2로 구글 로그인 구현하기 - OAuth 서비스 등록

🔐 OAuth 서비스 등록 - 구글 https://console.developers.google.com/ 사용자 인증 정보 만들기 > OAuth 클라이언트 ID User Type은 외부 다음으로 앱 정보를 입력해줍니다. 필수 정보만 입력해주면 됩니다. 범위는 email, profile, openId 로 설정해주었습니다. 필요한 것들 체크해주면 됩니다. 웹 애플리케이션을 클릭하면 리디렉션 URI 설정이 있습니다. 여기에 http://localhost:8080/login/oauth2/code/google을 적어줍니다. 그리고 만들기 버튼을 누르면..

허지렁이
'Server/Spring boot' 카테고리의 글 목록