From 05c74ca131add20dbcf23dc109e63c21b3e2be29 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 24 Feb 2021 18:11:57 +0800
Subject: [PATCH] Merge branch 'whole_new_trc20' into whole_new
---
src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java b/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java
index c31c084..06994e0 100644
--- a/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java
+++ b/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java
@@ -1,12 +1,20 @@
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
@@ -16,8 +24,13 @@
@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());
}
/**
@@ -34,7 +47,12 @@
}
@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();
+// }
}
--
Gitblit v1.9.1