/opcooc-storage

只是为了简化文件存储

Primary LanguageJavaApache License 2.0Apache-2.0

opcooc-storage-logo

Just to simplify file storage

maven license JDK Docs gitee star github star gitter

aws-s3 tencent-cos minio aliyun-oss qiliu

  • QQ exchange group 789585778,You can obtain detailed graphic documents and questions and answers for each project

What is opcooc-storage?

opcooc-storage encapsulates and expands aws s3

CN doc EN doc

Getting started

  • Add opcooc-storage dependency

    • Maven:
          <dependency>
            <groupId>com.opcooc</groupId>
            <artifactId>opcooc-storage-boot-starter</artifactId>
            <version>1.1.1</version>
          </dependency>
    • Gradle
      compile group: 'com.opcooc', name: 'opcooc-storage-boot-starter', version: '1.1.1'
  • Add config , add config information in application.yml

        opcooc:
          enabled: true
          primary: MINIO
          client:
            MINIO:
              bucket-name: opcooc
              end-point: http://xxx:9000
              access-key: xxx
              secret-key: xxx
            OSS:
              bucket-name: opcooc
              end-point: https://oss-cn-shanghai.aliyuncs.com
              access-key: xxx
              secret-key: xxx
  • Use it

        @RestController
        @RequiredArgsConstructor(onConstructor_ = @Autowired)
        @RequestMapping(value = "/client", produces = {APPLICATION_JSON_VALUE})
        public class ClientController {
        
            private final StorageClient storageClient;
        
            @GetMapping(value = "create-folder")
            public Response createFolder(@RequestParam String source, @RequestParam String folder) {
                storageClient.op(source).createFolder(folder);
                return Response.success();
            }
        
        }

This showcase is just a small part of opcooc-storage features. If you want to learn more, please refer to the documentation.

License

opcooc-storage is under the Apache 2.0 license. See the Apache License 2.0 file for details.