23a8aeaf858d4416acffc5133a4f56a6857c23c5.svn-base 987 B

12345678910111213141516171819202122232425262728293031323334
  1. package org.jeecg.config.oss;
  2. import org.jeecg.common.util.oss.OssBootUtil;
  3. import org.springframework.beans.factory.annotation.Value;
  4. import org.springframework.context.annotation.Bean;
  5. import org.springframework.context.annotation.Configuration;
  6. /**
  7. * 云存储 配置
  8. */
  9. @Configuration
  10. public class OssConfiguration {
  11. @Value("${jeecg.oss.endpoint}")
  12. private String endpoint;
  13. @Value("${jeecg.oss.accessKey}")
  14. private String accessKeyId;
  15. @Value("${jeecg.oss.secretKey}")
  16. private String accessKeySecret;
  17. @Value("${jeecg.oss.bucketName}")
  18. private String bucketName;
  19. @Value("${jeecg.oss.staticDomain:}")
  20. private String staticDomain;
  21. @Bean
  22. public void initOssBootConfiguration() {
  23. OssBootUtil.setEndPoint(endpoint);
  24. OssBootUtil.setAccessKeyId(accessKeyId);
  25. OssBootUtil.setAccessKeySecret(accessKeySecret);
  26. OssBootUtil.setBucketName(bucketName);
  27. OssBootUtil.setStaticDomain(staticDomain);
  28. }
  29. }