From 8ef1a2507e80e19485b6ec688ab46a004f4d395f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Miller=20=28=E9=94=BA=E4=BF=8A=29?= Date: Wed, 15 Sep 2021 14:59:56 +0800 Subject: [PATCH] perf($auth-center): remove Minio dependency --- auth-center/pom.xml | 7 ------- .../maf/authcenter/role/controller/RoleController.java | 2 +- .../src/main/resources/application-development-docker.yml | 7 ------- .../src/main/resources/application-development-local.yml | 7 ------- auth-center/src/main/resources/application-production.yml | 7 ------- auth-center/src/main/resources/application-stage.yml | 7 ------- auth-center/src/main/resources/application-test.yml | 7 ------- auth-center/src/main/resources/application.yml | 3 --- common/pom.xml | 6 +++++- pom.xml | 7 ------- spring-cloud-starter/pom.xml | 4 ---- .../poi/AbstractExcelDataController.java | 2 +- .../jmsoftware/maf/springcloudstarter/poi/OssUploader.java | 4 +++- 13 files changed, 10 insertions(+), 60 deletions(-) diff --git a/auth-center/pom.xml b/auth-center/pom.xml index 872c46cb..3d3a843b 100644 --- a/auth-center/pom.xml +++ b/auth-center/pom.xml @@ -245,12 +245,5 @@ poi-ooxml ${poi.version} - - - - io.minio - minio - ${minio.version} - diff --git a/auth-center/src/main/java/com/jmsoftware/maf/authcenter/role/controller/RoleController.java b/auth-center/src/main/java/com/jmsoftware/maf/authcenter/role/controller/RoleController.java index 961fd2f9..9a58382d 100644 --- a/auth-center/src/main/java/com/jmsoftware/maf/authcenter/role/controller/RoleController.java +++ b/auth-center/src/main/java/com/jmsoftware/maf/authcenter/role/controller/RoleController.java @@ -35,7 +35,7 @@ protected void beforeDatabaseOperation(List beanList) { } @Override - protected void executeDatabaseOperation(List beanList) throws Exception { + protected void executeDatabaseOperation(List beanList) { log.info("ExecuteDatabaseOperation: {}", beanList); this.roleService.save(beanList); } diff --git a/auth-center/src/main/resources/application-development-docker.yml b/auth-center/src/main/resources/application-development-docker.yml index aea1e370..f071294d 100644 --- a/auth-center/src/main/resources/application-development-docker.yml +++ b/auth-center/src/main/resources/application-development-docker.yml @@ -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 diff --git a/auth-center/src/main/resources/application-development-local.yml b/auth-center/src/main/resources/application-development-local.yml index d6dbfe95..bb71a0af 100644 --- a/auth-center/src/main/resources/application-development-local.yml +++ b/auth-center/src/main/resources/application-development-local.yml @@ -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 diff --git a/auth-center/src/main/resources/application-production.yml b/auth-center/src/main/resources/application-production.yml index 5c808175..0736b0bc 100644 --- a/auth-center/src/main/resources/application-production.yml +++ b/auth-center/src/main/resources/application-production.yml @@ -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 diff --git a/auth-center/src/main/resources/application-stage.yml b/auth-center/src/main/resources/application-stage.yml index 5c808175..0736b0bc 100644 --- a/auth-center/src/main/resources/application-stage.yml +++ b/auth-center/src/main/resources/application-stage.yml @@ -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 diff --git a/auth-center/src/main/resources/application-test.yml b/auth-center/src/main/resources/application-test.yml index 81332a9d..ae3c624b 100644 --- a/auth-center/src/main/resources/application-test.yml +++ b/auth-center/src/main/resources/application-test.yml @@ -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 diff --git a/auth-center/src/main/resources/application.yml b/auth-center/src/main/resources/application.yml index 5fb12cbd..7266d432 100644 --- a/auth-center/src/main/resources/application.yml +++ b/auth-center/src/main/resources/application.yml @@ -191,6 +191,3 @@ maf: jwt: # an hour ttl: 3600000 - -minio: - enabled: true diff --git a/common/pom.xml b/common/pom.xml index da04d6c1..5256e127 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -24,20 +24,24 @@ org.springframework spring-web + provided org.springframework.boot spring-boot-starter-validation + provided org.springframework.boot spring-boot-starter-security + provided true org.springframework.boot spring-boot-starter-json + provided diff --git a/pom.xml b/pom.xml index 883db89c..0935457e 100644 --- a/pom.xml +++ b/pom.xml @@ -284,12 +284,5 @@ hutool-all ${hutool-all.version} - - - - com.github.javafaker - javafaker - ${java-faker.version} - diff --git a/spring-cloud-starter/pom.xml b/spring-cloud-starter/pom.xml index 9b386607..714ca1b5 100644 --- a/spring-cloud-starter/pom.xml +++ b/spring-cloud-starter/pom.xml @@ -120,10 +120,6 @@ com.jmsoftware.maf common - - com.jmsoftware.maf - universal-ui - de.codecentric diff --git a/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/poi/AbstractExcelDataController.java b/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/poi/AbstractExcelDataController.java index 068f2f6f..9a6f1ac3 100644 --- a/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/poi/AbstractExcelDataController.java +++ b/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/poi/AbstractExcelDataController.java @@ -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); } diff --git a/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/poi/OssUploader.java b/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/poi/OssUploader.java index effb2d02..759c3a88 100644 --- a/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/poi/OssUploader.java +++ b/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/poi/OssUploader.java @@ -1,5 +1,7 @@ package com.jmsoftware.maf.springcloudstarter.poi; +import lombok.NonNull; + import java.io.IOException; import java.io.InputStream; @@ -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; }