-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: 로컬 인터셉터 추가 * refactor: TreeMap 으로 노래 캐싱 및 좋아요 실시간 반영 * refactor: 삽입 정렬로 정렬 속도 개선 * refactor: 로컬 실행 시 토큰이 아닌 Authorization의 memberId 를 사용하도록 변경 * config: 로컬 config 롤백 * fix: 삽입 정렬 로직 추가 * refactor: EntityManager 의존성 이동 및 메서드, 필드 이름 리팩터링 * refactor: 조건문 메서드 분리 * refactor: 접근 제어자 private 으로 변경 * refactor: KillingPart 가 AtomicInteger 를 필드로 갖도록 수정 * refactor: 사용하지 않는 dto 클래스 삭제 * refactor: 사용하지 않는 메서드 삭제 * refactor: 접근 제어자 private 으로 변경 * refactor: 중복 범위 검증 제거 * refactor: 분기문 제거 * feat: likeCount AtomicInteger 로 변경 및 좋아요 개수 데이터베이스와 동기화하는 로직 추가 * fix: setUp 메서드 실행 시점 변경 * refactor: synchronized 로 동시성 처리 * fix: cache 재생성 제거
- Loading branch information
Showing
27 changed files
with
531 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
backend/src/main/java/shook/shook/auth/config/LocalAuthConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package shook.shook.auth.config; | ||
|
||
import java.util.List; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.web.method.support.HandlerMethodArgumentResolver; | ||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
import shook.shook.auth.ui.argumentresolver.AuthArgumentResolver; | ||
import shook.shook.auth.ui.interceptor.LocalInterceptor; | ||
|
||
@Profile("local") | ||
@Configuration | ||
public class LocalAuthConfig implements WebMvcConfigurer { | ||
|
||
private final AuthArgumentResolver authArgumentResolver; | ||
private final LocalInterceptor localInterceptor; | ||
|
||
public LocalAuthConfig(final AuthArgumentResolver authArgumentResolver, final LocalInterceptor localInterceptor) { | ||
this.authArgumentResolver = authArgumentResolver; | ||
this.localInterceptor = localInterceptor; | ||
} | ||
|
||
@Override | ||
public void addInterceptors(final InterceptorRegistry registry) { | ||
registry.addInterceptor(localInterceptor); | ||
} | ||
|
||
@Override | ||
public void addArgumentResolvers(final List<HandlerMethodArgumentResolver> resolvers) { | ||
resolvers.add(authArgumentResolver); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
backend/src/main/java/shook/shook/auth/ui/interceptor/LocalInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package shook.shook.auth.ui.interceptor; | ||
|
||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.servlet.HandlerInterceptor; | ||
import shook.shook.auth.ui.AuthContext; | ||
|
||
@Profile("local") | ||
@Component | ||
public class LocalInterceptor implements HandlerInterceptor { | ||
|
||
private final AuthContext authContext; | ||
|
||
public LocalInterceptor(final AuthContext authContext) { | ||
this.authContext = authContext; | ||
} | ||
|
||
@Override | ||
public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response, final Object handler) | ||
throws Exception { | ||
final long memberId = Long.parseLong(request.getHeader("Authorization")); | ||
authContext.setAuthenticatedMember(memberId); | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.