Skip to content

Commit

Permalink
fix: JPA Redis Repository scan 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
dltjdgh0428 committed Apr 9, 2024
1 parent 1307723 commit 04a6821
Show file tree
Hide file tree
Showing 26 changed files with 51 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.book_everywhere.common.jwt.filter;

import com.book_everywhere.common.auth.dto.CustomOAuth2User;
import com.book_everywhere.domain.auth.dto.CustomOAuth2User;
import com.book_everywhere.common.jwt.token.JwtProvider;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.book_everywhere.common.jwt.filter;

import com.book_everywhere.common.auth.dto.CustomOAuth2User;
import com.book_everywhere.common.auth.dto.UserDto;
import com.book_everywhere.domain.auth.dto.CustomOAuth2User;
import com.book_everywhere.domain.auth.dto.UserDto;
import com.book_everywhere.common.jwt.token.JwtProvider;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
Expand All @@ -15,8 +15,6 @@
import org.springframework.web.filter.OncePerRequestFilter;

import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;

@RequiredArgsConstructor
public class JwtFilter extends OncePerRequestFilter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@RequiredArgsConstructor
@Configuration
@EnableRedisRepositories
//@EnableJpaRepositories(basePackages = "com.book_everywhere.common.auth.repository")
//@EnableRedisRepositories(basePackages = "com.book_everywhere.common.cache.repository")
public class RedisConfig {

// private static final Logger logger = LoggerFactory.getLogger(RedisConfig.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.book_everywhere.common.auth.config;
package com.book_everywhere.domain.auth.config;

import com.book_everywhere.common.auth.service.CustomOAuth2UserService;
import com.book_everywhere.domain.auth.service.CustomOAuth2UserService;
import com.book_everywhere.common.jwt.filter.JwtFilter;
import com.book_everywhere.common.jwt.token.JwtProvider;
import com.book_everywhere.common.jwt.filter.CustomSuccessHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.book_everywhere.common.auth.dto;
package com.book_everywhere.domain.auth.dto;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.oauth2.core.user.OAuth2User;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.book_everywhere.common.auth.dto;
package com.book_everywhere.domain.auth.dto;

import com.book_everywhere.common.auth.entity.Role;
import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.domain.auth.entity.Role;
import com.book_everywhere.domain.auth.entity.User;
import lombok.Builder;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.book_everywhere.common.auth.dto;
package com.book_everywhere.domain.auth.dto;


import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.book_everywhere.common.auth.entity;
package com.book_everywhere.domain.auth.entity;

public enum Role {
ROLE_ADMIN,ROLE_MEMBER
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.book_everywhere.common.auth.entity;
package com.book_everywhere.domain.auth.entity;

import com.book_everywhere.common.entity.BaseTimeEntity;
import com.book_everywhere.domain.review.entity.Review;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.book_everywhere.common.auth.repository;
package com.book_everywhere.domain.auth.repository;

import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.domain.auth.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.book_everywhere.common.auth.service;

import com.book_everywhere.common.auth.dto.CustomOAuth2User;
import com.book_everywhere.common.auth.dto.OAuthAttributes;
import com.book_everywhere.common.auth.dto.UserDto;
import com.book_everywhere.common.auth.entity.Role;
import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.common.auth.repository.UserRepository;
package com.book_everywhere.domain.auth.service;

import com.book_everywhere.domain.auth.dto.CustomOAuth2User;
import com.book_everywhere.domain.auth.dto.OAuthAttributes;
import com.book_everywhere.domain.auth.dto.UserDto;
import com.book_everywhere.domain.auth.entity.Role;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.domain.auth.repository.UserRepository;
import jakarta.servlet.http.HttpSession;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.book_everywhere.domain.likes.entity;

import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.common.entity.BaseTimeEntity;
import com.book_everywhere.domain.review.entity.Review;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.book_everywhere.domain.likes.service;

import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.common.auth.repository.UserRepository;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.domain.auth.repository.UserRepository;
import com.book_everywhere.domain.likes.repository.LikesRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.book_everywhere.domain.pin.entity;

import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.common.entity.BaseTimeEntity;
import jakarta.persistence.*;
import lombok.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.book_everywhere.domain.pin.entity.Pin;
import com.book_everywhere.domain.pin.repository.PinRepository;
import com.book_everywhere.domain.pin.repository.VisitRepository;
import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.common.auth.repository.UserRepository;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.domain.auth.repository.UserRepository;
import com.book_everywhere.domain.pin.entity.Visit;
import com.book_everywhere.domain.review.dto.ReviewRespDto;
import com.book_everywhere.common.exception.customs.CustomErrorCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.book_everywhere.domain.book.dto.BookRespDto;
import com.book_everywhere.domain.book.entity.Book;
import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.domain.pin.dto.PinRespDto;
import com.book_everywhere.domain.pin.entity.Pin;
import com.book_everywhere.domain.review.entity.Review;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.book_everywhere.domain.review.entity;

import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.domain.book.entity.Book;
import com.book_everywhere.common.entity.BaseTimeEntity;
import com.book_everywhere.domain.pin.entity.Pin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import com.book_everywhere.domain.pin.repository.PinRepository;
import com.book_everywhere.domain.review.entity.Review;
import com.book_everywhere.domain.review.repository.ReviewRepository;
import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.common.auth.repository.UserRepository;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.domain.auth.repository.UserRepository;
import com.book_everywhere.domain.tag.service.TaggedService;
import com.book_everywhere.common.exception.customs.CustomErrorCode;
import com.book_everywhere.common.exception.customs.EntityNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.book_everywhere.common.entity.BaseTimeEntity;
import com.book_everywhere.domain.pin.entity.Pin;
import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.domain.auth.entity.User;
import jakarta.persistence.*;
import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.book_everywhere.domain.tag.repository.TagRepository;
import com.book_everywhere.domain.tag.entity.Tagged;
import com.book_everywhere.domain.tag.repository.TaggedRepository;
import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.common.auth.repository.UserRepository;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.domain.auth.repository.UserRepository;
import com.book_everywhere.domain.review.dto.ReviewRespDto;
import com.book_everywhere.common.exception.customs.CustomErrorCode;
import com.book_everywhere.common.exception.customs.EntityNotFoundException;
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ spring:
blue: blue, common, secret
green: green, common, secret

data:
redis:
repositories:
enabled: false

server:
env: blue

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.book_everywhere.domain.auth;


import com.book_everywhere.common.auth.entity.Role;
import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.domain.auth.entity.Role;
import com.book_everywhere.domain.auth.entity.User;

import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.book_everywhere.domain.book.repository;

import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.common.auth.repository.UserRepository;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.domain.auth.repository.UserRepository;
import com.book_everywhere.domain.book.entity.Book;
import com.book_everywhere.domain.auth.UserTestBuilder;
import com.book_everywhere.domain.book.dto.BookRespDtoBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.book_everywhere.domain.likes.repository;

import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.common.auth.repository.UserRepository;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.domain.auth.repository.UserRepository;
import com.book_everywhere.domain.book.entity.Book;
import com.book_everywhere.domain.book.repository.BookRepository;
import com.book_everywhere.domain.auth.UserTestBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.book_everywhere.domain.book.dto.BookRespDto;
import com.book_everywhere.domain.pin.dto.PinRespDto;
import com.book_everywhere.domain.review.entity.Review;
import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.domain.auth.entity.User;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.book_everywhere.domain.review.service;

import com.book_everywhere.common.auth.entity.User;
import com.book_everywhere.common.auth.repository.UserRepository;
import com.book_everywhere.domain.auth.entity.User;
import com.book_everywhere.domain.auth.repository.UserRepository;
import com.book_everywhere.domain.book.dto.BookRespDto;
import com.book_everywhere.domain.book.repository.BookRepository;
import com.book_everywhere.domain.auth.UserTestBuilder;
Expand Down

0 comments on commit 04a6821

Please sign in to comment.