mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-23 11:09:29 +08:00
上传仅使用minio
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
package xyz.playedu.api.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
* @create 2023/2/28 16:38
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
public class FileStorageConfig {
|
||||
|
||||
@Value("${spring.file-storage.default-platform}")
|
||||
private String defaultPlatform;
|
||||
|
||||
@Value("${spring.file-storage.minio[0].domain}")
|
||||
private String domain;
|
||||
|
||||
@Value("${spring.file-storage.minio[0].bucket-name}")
|
||||
private String bucket;
|
||||
|
||||
@Value("${spring.file-storage.minio[0].base-path}")
|
||||
private String basePath;
|
||||
|
||||
}
|
||||
39
src/main/java/xyz/playedu/api/config/MinioConfig.java
Normal file
39
src/main/java/xyz/playedu/api/config/MinioConfig.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package xyz.playedu.api.config;
|
||||
|
||||
import io.minio.MinioClient;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
* @create 2023/2/28 16:38
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
public class MinioConfig {
|
||||
|
||||
@Value("${minio.domain}")
|
||||
private String domain;
|
||||
|
||||
@Value("${minio.bucket}")
|
||||
private String bucket;
|
||||
|
||||
@Value("${minio.access-key}")
|
||||
private String accessKey;
|
||||
|
||||
@Value("${minio.secret-key}")
|
||||
private String secretKey;
|
||||
|
||||
@Value("${minio.end-point}")
|
||||
private String endPoint;
|
||||
|
||||
@Bean
|
||||
public MinioClient getMinioClient() {
|
||||
return MinioClient.builder()
|
||||
.endpoint(this.endPoint)
|
||||
.credentials(this.accessKey, this.secretKey)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user