An open API service indexing awesome lists of open source software.

https://github.com/linux-china/spring-boot-starter-oss

Spring Boot Start with Aliyun OSS
https://github.com/linux-china/spring-boot-starter-oss

Last synced: 8 months ago
JSON representation

Spring Boot Start with Aliyun OSS

Awesome Lists containing this project

README

          

spring-boot-start-oss
===================================
Spring boot with aliyun oss support

### usage
in pom.xml add following dependency:


org.mvnsearch.boot
spring-boot-starter-oss
1.0.0-SNAPSHOT


in application.properties file, please add following keys:

spring.oss.key=xxxx
spring.oss.secret=yyyy
spring.oss.bucket=xxx-dev

in your code you can use OssClient directly:

@Autowired
OSSClient ossClient;

you can use FileStorageService API to operate file:

@Autowired
FileStorageService fileStorageService;

### Spring XML Configuration
If you want to setup bean in Spring xml file, please use following code:












### spring-boot-start-oss service List

* org.mvnsearch.boot.oss.FileStorageService: API to operate the file
* com.aliyun.oss.OSSClient: aliyun OSSClient

Please use FileStorageService as usual, not OSSClient.

### Aliyun OSS endpoint

Please visit http://localhost:8080/oss to view detail information.

### FaQ

* Please upload a "ok.txt" under your buket for health indicator.