添加 Minio 配置和支持
在 `application-prod.yml` 和 `application-dev.yml` 中添加了 Minio 的配置项,并引入了 Minio 依赖。新增 `MinioProperties` 和 `MinioConfig` 类以支持 Minio 客户端的配置和初始化。
This commit is contained in:
parent
517f036726
commit
fcd88baf67
14
pom.xml
14
pom.xml
@ -63,6 +63,12 @@
|
||||
<version>2.0.51</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.5.13</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -79,6 +85,14 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>9</source>
|
||||
<target>9</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package top.yuchat.crawler.video.config;
|
||||
|
||||
import io.minio.MinioClient;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class MinioConfig {
|
||||
|
||||
private final MinioProperties minioProperties;
|
||||
|
||||
@Bean
|
||||
public MinioClient minioClient() {
|
||||
return MinioClient.builder()
|
||||
.endpoint(minioProperties.getEndpoint())
|
||||
.credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package top.yuchat.crawler.video.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Data
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "minio")
|
||||
public class MinioProperties {
|
||||
|
||||
/**
|
||||
* 访问地址
|
||||
*/
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
* 访问秘钥
|
||||
*/
|
||||
private String accessKey;
|
||||
|
||||
/**
|
||||
* 秘钥密码
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* 数据桶
|
||||
*/
|
||||
private String bucket;
|
||||
}
|
||||
@ -5,7 +5,8 @@ spring:
|
||||
username: postgres
|
||||
password: longqi@1314
|
||||
|
||||
top:
|
||||
yuchat:
|
||||
download:
|
||||
path: F:\videos
|
||||
minio:
|
||||
endpoint: http://10.101.83.84:9000
|
||||
access-key: CGG6QZHvKI0JEuXM5gBJ
|
||||
secret-key: QXosu8wFLEjVMTdQ63mxmdYVJ1SFwbsGarXtkJxR
|
||||
bucket: yuchat-video
|
||||
|
||||
@ -5,6 +5,11 @@ spring:
|
||||
url: jdbc:postgresql://yuchat-databases:5432/postgres
|
||||
username: postgres
|
||||
password: longqi@1314
|
||||
minio:
|
||||
endpoint: http://minio.yuchat:9000
|
||||
access-key: CGG6QZHvKI0JEuXM5gBJ
|
||||
secret-key: QXosu8wFLEjVMTdQ63mxmdYVJ1SFwbsGarXtkJxR
|
||||
bucket: yuchat-video
|
||||
|
||||
# 日志级别,生产环境改为warn
|
||||
logging:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user