public class Hello implements Function<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
@Override
public APIGatewayProxyResponseEvent apply(APIGatewayProxyRequestEvent input) {
APIGatewayProxyResponseEvent responseEvent = new APIGatewayProxyResponseEvent();
responseEvent.setStatusCode(200);
responseEvent.setBody("Hello! Reached the Spring Cloud Function with message: " + input.getBody());
return responseEvent;
}
}
我有像这位老师所说的代码,我需要实现apply函数。我想做的是跟随。例如,如果我在javascript提交按钮中键入一些字符串,则希望该字符串进入我的“ APIGatewayProxyRequestEvent输入”中,以便我可以返回此字符串。如果我问的太含糊或太大,请告诉我我需要学习的关键词才能做到这一点