Attempt to write JSON by hand

This commit is contained in:
Dave Syer
2018-01-19 09:28:26 +00:00
parent 308e4d5514
commit 7604de3ca7
10 changed files with 224 additions and 182 deletions

View File

@@ -0,0 +1,7 @@
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"AzureWebJobsDashboard": ""
}
}

View File

@@ -0,0 +1,16 @@
{
"scriptFile" : "../function-sample-azure-1.0.0.BUILD-SNAPSHOT-azure.jar",
"entryPoint" : "example.FooHandler.handleRequest",
"bindings" : [ {
"type" : "httpTrigger",
"name" : "foo",
"direction" : "in",
"authLevel" : "anonymous",
"methods" : [ "get", "post" ]
}, {
"type" : "http",
"name" : "$return",
"direction" : "out"
} ],
"disabled" : false
}

View File

@@ -17,18 +17,22 @@
package example;
import com.microsoft.azure.serverless.functions.ExecutionContext;
import com.microsoft.azure.serverless.functions.annotation.HttpOutput;
import com.microsoft.azure.serverless.functions.annotation.HttpTrigger;
import org.springframework.cloud.function.adapter.azure.AzureSpringBootRequestHandler;
/**
* @author Soby Chacko
*/
public class FooHandler extends AzureSpringBootRequestHandler {
public class FooHandler extends AzureSpringBootRequestHandler<Foo, Bar> {
@SuppressWarnings("unchecked")
public Bar handleRequest(Foo foo, ExecutionContext context) {
@Override
public @HttpOutput(name = "bar") Bar handleRequest(
@HttpTrigger(name = "foo", methods = { "get", "post" }) Foo foo,
ExecutionContext context) {
context.getLogger().info("Invoking entry point method");
return (Bar)super.handleRequest(foo,context);
return (Bar) super.handleRequest(foo, context);
}
}