Skip to content

Fix Lowcoder Api Server Launch Failure #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions server/api-service/lowcoder-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down
4 changes: 0 additions & 4 deletions server/api-service/lowcoder-plugins/graphqlPlugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@
<artifactId>netty-http-authenticator</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;
import java.util.stream.Collectors;
Expand All @@ -35,7 +32,6 @@

import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.bson.internal.Base64;
import org.lowcoder.plugin.graphql.constants.ResponseDataType;
import org.lowcoder.plugin.graphql.helpers.AuthHelper;
import org.lowcoder.plugin.graphql.helpers.BufferingFilter;
Expand Down Expand Up @@ -427,13 +423,13 @@ private ResponseBodyData parseResponseDataInfo(byte[] body, MediaType contentTyp
MediaType.IMAGE_JPEG.equals(contentType) ||
MediaType.IMAGE_PNG.equals(contentType)) {
return ResponseBodyData.builder()
.body(Base64.encode(body))
.body(Base64.getEncoder().encode(body))
.dataType(ResponseDataType.IMAGE)
.build();
}
if (BINARY_DATA_TYPES.contains(contentType.toString())) {
return ResponseBodyData.builder()
.body(Base64.encode(body))
.body(Base64.getEncoder().encode(body))
.dataType(ResponseDataType.BINARY)
.build();
}
Expand Down
5 changes: 0 additions & 5 deletions server/api-service/lowcoder-plugins/restApiPlugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.bson.internal.Base64;
import org.lowcoder.plugin.restapi.constants.ResponseDataType;
import org.lowcoder.plugin.restapi.helpers.AuthHelper;
import org.lowcoder.plugin.restapi.helpers.BufferingFilter;
Expand Down Expand Up @@ -398,13 +397,13 @@ private ResponseBodyData parseResponseDataInfo(byte[] body, MediaType contentTyp

if (isPicture(contentType)) {
return ResponseBodyData.builder()
.body(Base64.encode(body))
.body(Base64.getEncoder().encode(body))
.dataType(ResponseDataType.IMAGE)
.build();
}
if (isBinary(contentType)) {
return ResponseBodyData.builder()
.body(Base64.encode(body))
.body(Base64.getEncoder().encode(body))
.dataType(ResponseDataType.BINARY)
.build();
}
Expand Down
5 changes: 0 additions & 5 deletions server/api-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,6 @@
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.12.8</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down