diff --git a/auth/authentication/src/main/java/com/tencent/supersonic/auth/authentication/interceptor/AuthenticationInterceptor.java b/auth/authentication/src/main/java/com/tencent/supersonic/auth/authentication/interceptor/AuthenticationInterceptor.java index a395c2aac..24ff43318 100644 --- a/auth/authentication/src/main/java/com/tencent/supersonic/auth/authentication/interceptor/AuthenticationInterceptor.java +++ b/auth/authentication/src/main/java/com/tencent/supersonic/auth/authentication/interceptor/AuthenticationInterceptor.java @@ -1,7 +1,7 @@ package com.tencent.supersonic.auth.authentication.interceptor; import com.tencent.supersonic.auth.api.authentication.config.AuthenticationConfig; -import com.tencent.supersonic.auth.authentication.service.UserServiceImpl; +import com.tencent.supersonic.auth.api.authentication.service.UserService; import com.tencent.supersonic.auth.authentication.utils.TokenService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -16,7 +16,7 @@ public abstract class AuthenticationInterceptor implements HandlerInterceptor { protected AuthenticationConfig authenticationConfig; - protected UserServiceImpl userServiceImpl; + protected UserService userService; protected TokenService tokenService; diff --git a/auth/authentication/src/main/java/com/tencent/supersonic/auth/authentication/interceptor/DefaultAuthenticationInterceptor.java b/auth/authentication/src/main/java/com/tencent/supersonic/auth/authentication/interceptor/DefaultAuthenticationInterceptor.java index 47886aa94..0942305c5 100644 --- a/auth/authentication/src/main/java/com/tencent/supersonic/auth/authentication/interceptor/DefaultAuthenticationInterceptor.java +++ b/auth/authentication/src/main/java/com/tencent/supersonic/auth/authentication/interceptor/DefaultAuthenticationInterceptor.java @@ -3,7 +3,7 @@ package com.tencent.supersonic.auth.authentication.interceptor; import com.tencent.supersonic.auth.api.authentication.annotation.AuthenticationIgnore; import com.tencent.supersonic.auth.api.authentication.config.AuthenticationConfig; import com.tencent.supersonic.auth.api.authentication.pojo.UserWithPassword; -import com.tencent.supersonic.auth.authentication.service.UserServiceImpl; +import com.tencent.supersonic.auth.api.authentication.service.UserService; import com.tencent.supersonic.auth.authentication.utils.TokenService; import com.tencent.supersonic.common.pojo.exception.AccessException; import com.tencent.supersonic.common.util.ContextUtils; @@ -16,12 +16,7 @@ import org.springframework.web.method.HandlerMethod; import java.lang.reflect.Method; import java.util.Optional; -import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_IS_ADMIN; -import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_USER_DISPLAY_NAME; -import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_USER_EMAIL; -import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_USER_ID; -import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_USER_NAME; -import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.TOKEN_USER_PASSWORD; +import static com.tencent.supersonic.auth.api.authentication.constant.UserConstants.*; @Slf4j public class DefaultAuthenticationInterceptor extends AuthenticationInterceptor { @@ -30,7 +25,7 @@ public class DefaultAuthenticationInterceptor extends AuthenticationInterceptor public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws AccessException { authenticationConfig = ContextUtils.getBean(AuthenticationConfig.class); - userServiceImpl = ContextUtils.getBean(UserServiceImpl.class); + userService = ContextUtils.getBean(UserService.class); tokenService = ContextUtils.getBean(TokenService.class); if (!authenticationConfig.isEnabled()) { return true;