| | |
| | | package com.xcong.excoin.configurations; |
| | | |
| | | import com.aliyun.oss.OSS; |
| | | import com.aliyun.oss.OSSClientBuilder; |
| | | import com.xcong.excoin.configurations.properties.AliOssProperties; |
| | | import com.xcong.excoin.configurations.security.UserAuthenticationArgumentResolver; |
| | | import com.xcong.excoin.utils.SpringContextHolder; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.SpringBootConfiguration; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.web.method.support.HandlerMethodArgumentResolver; |
| | | import org.springframework.web.servlet.config.annotation.CorsRegistry; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | @Slf4j |
| | | public class WebMvcConfig implements WebMvcConfigurer { |
| | | |
| | | @Resource |
| | | private AliOssProperties aliOssProperties; |
| | | |
| | | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) { |
| | | resolvers.add(new UserAuthenticationArgumentResolver()); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Bean |
| | | public SpringContextHolder springContextHolder() { |
| | | return new SpringContextHolder(); |
| | | public OSS ossClient() { |
| | | return new OSSClientBuilder().build(aliOssProperties.getEndPoint(), aliOssProperties.getAccessKeyId(), aliOssProperties.getAccessKeySecret()); |
| | | } |
| | | |
| | | // @Bean |
| | | // public SpringContextHolder springContextHolder() { |
| | | // return new SpringContextHolder(); |
| | | // } |
| | | } |