-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathWebConfig.java
More file actions
32 lines (24 loc) · 1.08 KB
/
WebConfig.java
File metadata and controls
32 lines (24 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.yourssu.roomescape.config;
import com.yourssu.roomescape.auth.LoginMemberArgumentResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.*;
import java.util.List;
@Configuration
public class WebConfig implements WebMvcConfigurer {
private final AdminInterceptor adminInterceptor;
private final LoginMemberArgumentResolver loginMemberArgumentResolver;
public WebConfig(AdminInterceptor adminInterceptor, LoginMemberArgumentResolver loginMemberArgumentResolver) {
this.adminInterceptor = adminInterceptor;
this.loginMemberArgumentResolver = loginMemberArgumentResolver;
}
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
resolvers.add(loginMemberArgumentResolver);
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(adminInterceptor)
.addPathPatterns("/admin");
}
}