Skip to content

Commit

Permalink
remove unnecessary dependencies for this project
Browse files Browse the repository at this point in the history
  • Loading branch information
luketn committed Aug 17, 2018
1 parent 86ea78f commit 911778d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 49 deletions.
29 changes: 2 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,8 @@
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-log4j2</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.8.5</version>
<artifactId>aws-lambda-java-core</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
17 changes: 0 additions & 17 deletions src/main/java/com/mycodefu/ApiGatewayResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
import java.util.Collections;
import java.util.Map;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class ApiGatewayResponse {

private final int statusCode;
Expand Down Expand Up @@ -48,10 +42,6 @@ public static Builder builder() {

public static class Builder {

private static final Logger LOG = LogManager.getLogger(ApiGatewayResponse.Builder.class);

private static final ObjectMapper objectMapper = new ObjectMapper();

private int statusCode = 200;
private Map<String, String> headers = Collections.emptyMap();
private String rawBody;
Expand Down Expand Up @@ -114,13 +104,6 @@ public ApiGatewayResponse build() {
String body = null;
if (rawBody != null) {
body = rawBody;
} else if (objectBody != null) {
try {
body = objectMapper.writeValueAsString(objectBody);
} catch (JsonProcessingException e) {
LOG.error("failed to serialize object", e);
throw new RuntimeException(e);
}
} else if (binaryBody != null) {
body = new String(Base64.getEncoder().encode(binaryBody), StandardCharsets.UTF_8);
}
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/com/mycodefu/Handler.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import java.io.IOException;
import java.util.*;
import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.logging.LogManager;
import java.util.logging.Logger;

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
Expand All @@ -17,13 +16,11 @@

public class Handler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> {

private static final Logger LOG = LogManager.getLogger(Handler.class);
public static final int DEFAULT_WIDTH = 1024;
public static final int DEFAULT_HEIGHT = 768;

@Override
public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) {
LOG.info("received: {}", input);

Map<String, String> parameters = (Map<String, String>) input.get("queryStringParameters");
int width;
Expand Down
Binary file modified test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 911778d

Please sign in to comment.