From 28eb26d68f7a2a4e6b316c3ea9f511aa143db66e Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Mon, 30 Sep 2024 16:57:18 +0800
Subject: [PATCH] 55测试环境
---
src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java b/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java
index cc8e77b..06994e0 100644
--- a/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java
+++ b/src/main/java/com/xcong/excoin/configurations/WebMvcConfig.java
@@ -1,5 +1,8 @@
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;
@@ -10,6 +13,7 @@
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import javax.annotation.Resource;
import java.util.List;
/**
@@ -19,6 +23,10 @@
@SpringBootConfiguration
@Slf4j
public class WebMvcConfig implements WebMvcConfigurer {
+
+ @Resource
+ private AliOssProperties aliOssProperties;
+
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
@@ -39,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