Skip to content

Commit

Permalink
perf($auth-center): remove Minio dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Sep 15, 2021
1 parent 6473942 commit 8ef1a25
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 60 deletions.
7 changes: 0 additions & 7 deletions auth-center/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,5 @@
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>

<!-- OSS Dependencies -->
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>${minio.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected void beforeDatabaseOperation(List<RoleExcelBean> beanList) {
}

@Override
protected void executeDatabaseOperation(List<RoleExcelBean> beanList) throws Exception {
protected void executeDatabaseOperation(List<RoleExcelBean> beanList) {
log.info("ExecuteDatabaseOperation: {}", beanList);
this.roleService.save(beanList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,3 @@ redis:
maf:
configuration:
swagger-enabled: true

minio:
endpoint: http://maf-minio
port: 9000
access-key: maf_minio_root_user
secret-key: jm@minio
bucket-name: maf
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,3 @@ logging:
maf:
configuration:
swagger-enabled: true

minio:
endpoint: http://localhost
port: 9900
access-key: maf_minio_root_user
secret-key: jm@minio
bucket-name: maf
7 changes: 0 additions & 7 deletions auth-center/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,3 @@ redis:
maf:
configuration:
swagger-enabled: false

minio:
endpoint: http://maf-minio
port: 9000
access-key: maf_minio_root_user
secret-key: jm@minio
bucket-name: maf
7 changes: 0 additions & 7 deletions auth-center/src/main/resources/application-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,3 @@ redis:
maf:
configuration:
swagger-enabled: false

minio:
endpoint: http://maf-minio
port: 9000
access-key: maf_minio_root_user
secret-key: jm@minio
bucket-name: maf
7 changes: 0 additions & 7 deletions auth-center/src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,3 @@ redis:
maf:
configuration:
swagger-enabled: true

minio:
endpoint: http://maf-minio
port: 9000
access-key: maf_minio_root_user
secret-key: jm@minio
bucket-name: maf
3 changes: 0 additions & 3 deletions auth-center/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,3 @@ maf:
jwt:
# an hour
ttl: 3600000

minio:
enabled: true
6 changes: 5 additions & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand All @@ -24,20 +24,24 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<scope>provided</scope>
</dependency>
<!-- Depend on spring-boot-starter-security, cuz `UserPrincipal` needs to extend `UserDetails` -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
7 changes: 0 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,5 @@
<artifactId>hutool-all</artifactId>
<version>${hutool-all.version}</version>
</dependency>

<!-- Brings the popular ruby faker gem to Java https://github.com/DiUS/java-faker -->
<dependency>
<groupId>com.github.javafaker</groupId>
<artifactId>javafaker</artifactId>
<version>${java-faker.version}</version>
</dependency>
</dependencies>
</project>
4 changes: 0 additions & 4 deletions spring-cloud-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@
<groupId>com.jmsoftware.maf</groupId>
<artifactId>common</artifactId>
</dependency>
<dependency>
<groupId>com.jmsoftware.maf</groupId>
<artifactId>universal-ui</artifactId>
</dependency>

<dependency>
<groupId>de.codecentric</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ private void uploadWorkbook() {
@Cleanup val outputStream = new ByteArrayOutputStream((int) DataSize.ofBytes(512).toBytes());
this.workbook.get().write(outputStream);
@Cleanup val inputStream = new BufferedInputStream(new ByteArrayInputStream(outputStream.toByteArray()));
val filePath = this.ossUploader.upload(this.getTemplateFileName(), inputStream);
val filePath = this.ossUploader.upload(this.fileName.get(), inputStream);
log.info("Uploaded excel with exception message. filePath: {}", filePath);
this.excelFilePath.set(filePath);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.jmsoftware.maf.springcloudstarter.poi;

import lombok.NonNull;

import java.io.IOException;
import java.io.InputStream;

Expand All @@ -18,5 +20,5 @@ public interface OssUploader {
* @return the string
* @throws IOException the io exception
*/
String upload(String name, InputStream inputStream) throws IOException;
String upload(@NonNull String name, @NonNull InputStream inputStream) throws IOException;
}

0 comments on commit 8ef1a25

Please sign in to comment.