Solon

minio7-solon-plugin

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

1、描述

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

2、配置示例

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

3、应用示例

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();
    }
}