Giter Club home page Giter Club logo

oss-starter's Introduction

oss-starter

意在简化OSS存储配置,并引入自己封装的storageApi,轻松接入阿里云对象存储!

本项目依赖:

spring-boot 自动配置依赖

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-autoconfigure</artifactId>
    </dependency>

存储操作依赖(以下简称storageApi)

    <dependency>
        <groupId>com.luckysweetheart.starter</groupId>
        <artifactId>storage</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>

由于存储storageApi 依赖aliyun-oss-sdk ,每次spring容器启动之前,必须初始化OSSClient对象,通过本项目,可在spring-boot项目中简单的使用OSS存储

example

  1. 引入starter
    <dependency>
        <groupId>com.luckysweetheart.starter</groupId>
        <artifactId>oss-starter</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
  1. application.xml or application.yaml 文件:
spring:
  oss :
    endpoint : oss-cn-beijing.aliyuncs.com
    accessKeyId : LTAI5AZC3EzQyaSv
    secretAccessKey : LxsRHeOECzxWZPc3F1wkAIGHGtMNlk

注意:如果不指定上面的内容,将会默认以上配置。

  1. 开始使用
    @Resource
    private StorageApi storageApi;

    @Test
    public void contextLoads() throws StorageException {
        System.out.println(storageApi.groupList()); // 输出组列表
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.