Solon

minio-solon-cloud-plugin

v2.7.5 </> markdown

此插件,由社区成员(浅念)贡献

<dependency>
    <groupId>org.noear</groupId>
    <artifactId>minio-solon-cloud-plugin</artifactId>
</dependency>

1、描述

分布式扩展插件。基于 minio 适配的 solon cloud 插件。提供文件存储服务。

2、云端能力接口

接口说明备注
CloudFileService云端文件服务

3、配置示例

solon.cloud.minio.file:
    endpoint: 'https://play.min.io'
    regionId: 'us-west-1'
    bucket: 'asiatrip'
    accessKey: 'Q3AM3UQ867SPQQA43P2F'
    secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'

4、应用示例

public class DemoApp {
    public void main(String[] args) {
        SolonApp app = Solon.start(DemoApp.class, args);

        String key = "test/" + Utils.guid();
        String val = "Hello world!";
        
        //上传媒体
        Result rst = CloudClient.file().put(key, new Media(val));
        
        //获取媒体,并转为字符串
        String val2 = CloudClient.file().get(key).bodyAsString();
    }
}