-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
61 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 10 additions & 14 deletions
24
SCTransformation/Templates/JavaApplication/controller/smartcontract/ControllerEvents.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,28 @@ | ||
€eventArray:{eventName| | ||
@CrossOrigin | ||
@RequestMapping(value = "/query/€eventName€", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE\}) | ||
public List<Occurrence> query€eventName€(@RequestBody QueryInput input) { | ||
public List<Occurrence> query€event.FirstCapital€(@RequestBody QueryInput input) { | ||
List<Parameter> parameters= new ArrayList<Parameter>(){ | ||
€eventoutputparameterarray:{it|{add(new Parameter().builder().name("€it.name€").type("{\"type\": \"€it.type€\"\}").build());\}};separator="\n"€ | ||
€eventoutputparameterarray:{it|{add(new Parameter().builder().name("€it.name€").type("{\"type\": \"€it.type€\"\}").build());\}};separator="\n"€ | ||
\}; | ||
return scipClientFunctions.performQuery(null,"€eventName€",parameters,input.getFilter(),input.getTimeFrame()); | ||
\} | ||
|
||
//TODO: Generate Mapping | ||
@CrossOrigin | ||
@RequestMapping(value = "/subscribe/€eventName€", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE\}) | ||
public Observable<SubscribeResponse> subscribe€eventName€(@RequestBody SubscribeInput input) { | ||
List<Parameter> parameters= new ArrayList<Parameter>(){{ | ||
//TODO: Generated parameters | ||
add(new Parameter().builder().name("name").type("type").value("value").build()); | ||
\}\}; | ||
public Observable<SubscribeResponse> subscribe€event.FirstCapital€(@RequestBody SubscribeInput input) { | ||
List<Parameter> parameters= new ArrayList<Parameter>(){ | ||
€eventoutputparameterarray:{it|{add(new Parameter().builder().name("€it.name€").type("{\"type\": \"€it.type€\"\}").build());\}};separator="\n"€ | ||
\}; | ||
return scipClientFunctions.performSubscribe(null,"€eventName€",parameters,input.getFilter(),input.getCorrelationIdentifier(), input.getDegreeOfConfidence()); | ||
\} | ||
|
||
//TODO: Generate Mapping | ||
@CrossOrigin | ||
@RequestMapping(value = "/unsubscribe/€eventName€", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE\}) | ||
public UnsubscribeResponse unsubscribe€eventName€() { | ||
List<Parameter> parameters= new ArrayList<Parameter>(){{ | ||
//TODO: Generated parameters | ||
add(new Parameter().builder().name("name").type("type").value("value").build()); | ||
\}\}; | ||
public UnsubscribeResponse unsubscribe€event.FirstCapital€() { | ||
List<Parameter> parameters= new ArrayList<Parameter>(){ | ||
€eventoutputparameterarray:{it|{add(new Parameter().builder().name("€it.name€").type("{\"type\": \"€it.type€\"\}").build());\}};separator="\n"€ | ||
\}; | ||
return scipClientFunctions.performUnsubscribe("€eventName€",null,parameters,null); | ||
\} | ||
};separator="\n"€ |
2 changes: 1 addition & 1 deletion
2
SCTransformation/Templates/JavaApplication/controller/smartcontract/ControllerFooter.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 23 additions & 30 deletions
53
SCTransformation/Templates/JavaApplication/controller/smartcontract/ControllerFunctions.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,40 @@ | ||
€functionArray:{function| | ||
@CrossOrigin | ||
@RequestMapping(value = "/invoke/€function.Name€", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE\}) | ||
public CompletableFuture<InvokeResponse> invoke€function.FirstCapital€(@RequestBody €functionParameter€Parameter parameter) { | ||
|
||
public InvokeResponse invoke€function.FirstCapital€(@RequestBody €functionParameter€Parameter parameter) throws ExecutionException, InterruptedException { | ||
List<Parameter> inputParameters = new ArrayList<Parameter>(){ | ||
€inputparameterarray:{it|{add(Parameter.builder().name("€it.Name€").type("{\"type\": \"€it.ParamType€\"\}").value(parameter.get€it.FirstCapital€()).build());\}};separator="\n"€ | ||
€inputparameterarray:{it|{add(Parameter.builder().name("€it.Name€").type("{\"type\": \"€it.ParamType€\"\}").value(parameter.get€it.FirstCapital€()).build());\}};separator="\n"€ | ||
\}; | ||
List<Parameter> outputParameters = new ArrayList<Parameter>(){ | ||
€outputparameterarray:{it|{add(new Parameter().builder().name("€it.name€").type("{\"type\": \"€it.type€\"\}").build());\}};separator="\n"€ | ||
€outputparameterarray:{it|{add(new Parameter().builder().name("€it.name€").type("{\"type\": \"€it.type€\"\}").build());\}};separator="\n"€ | ||
\}; | ||
return scipClientFunctions.performInvoke("€function.Name€",inputParameters,outputParameters,parameter.getDegreeOfConfidence()); | ||
return scipClientFunctions.performInvoke("€function.Name€",inputParameters,outputParameters,parameter.getDegreeOfConfidence()).get(); | ||
\} | ||
|
||
//TODO: | ||
@CrossOrigin | ||
@RequestMapping(value = "/query/€function.Name€", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE\}) | ||
public List<Occurrence> query€function.FirstCapital€(@RequestBody QueryInput input) { | ||
List<Parameter> parameters= new ArrayList<Parameter>(){{ | ||
//TODO: Generated parameters | ||
add(new Parameter().builder().name("name").type("type").value("value").build()); | ||
\}\}; | ||
return scipClientFunctions.performQuery("€function.Name€",null,parameters,input.getFilter(),input.getTimeFrame()); | ||
\} | ||
@CrossOrigin | ||
@RequestMapping(value = "/query/€function.Name€", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE\}) | ||
public List<Occurrence> query€function.FirstCapital€(@RequestBody QueryInput input) { | ||
List<Parameter> parameters= new ArrayList<Parameter>(){ | ||
€inputparameterarray:{it|{add(Parameter.builder().name("€it.Name€").type("{\"type\": \"€it.ParamType€\"\}").build());\}};separator="\n"€ | ||
\}; | ||
return scipClientFunctions.performQuery("€function.Name€",null,parameters,input.getFilter(),input.getTimeFrame()); | ||
\} | ||
|
||
//TODO: Generate Mapping | ||
@CrossOrigin | ||
@RequestMapping(value = "/subscribe/€function.Name€", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE\}) | ||
public Observable<SubscribeResponse> subscribe€function.FirstCapital€(@RequestBody SubscribeInput input) { | ||
List<Parameter> parameters= new ArrayList<Parameter>(){{ | ||
//TODO: Generated parameters | ||
add(new Parameter().builder().name("name").type("type").value("value").build()); | ||
\}\}; | ||
List<Parameter> parameters= new ArrayList<Parameter>(){ | ||
€inputparameterarray:{it|{add(Parameter.builder().name("€it.Name€").type("{\"type\": \"€it.ParamType€\"\}").build());\}};separator="\n"€ | ||
\}; | ||
return scipClientFunctions.performSubscribe("€function.Name€",null,parameters,input.getFilter(),input.getCorrelationIdentifier(),input.getDegreeOfConfidence()); | ||
\} | ||
|
||
//TODO: Generate Mapping | ||
@CrossOrigin | ||
@RequestMapping(value = "/unsubscribe/€function.Name€", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE\}) | ||
public UnsubscribeResponse unsubscribe€function.FirstCapital€() { | ||
List<Parameter> parameters= new ArrayList<Parameter>(){{ | ||
//TODO: Generated parameters | ||
add(new Parameter().builder().name("name").type("type").value("value").build()); | ||
\}\}; | ||
return scipClientFunctions.performUnsubscribe(null,"€function.Name€",parameters,null); | ||
\} | ||
@CrossOrigin | ||
@RequestMapping(value = "/unsubscribe/€function.Name€", method = RequestMethod.POST, consumes = {MediaType.APPLICATION_JSON_VALUE\}) | ||
public UnsubscribeResponse unsubscribe€function.FirstCapital€() { | ||
List<Parameter> parameters= new ArrayList<Parameter>(){ | ||
€inputparameterarray:{it|{add(Parameter.builder().name("€it.Name€").type("{\"type\": \"€it.ParamType€\"\}").build());\}};separator="\n"€ | ||
\}; | ||
return scipClientFunctions.performUnsubscribe(null,"€function.Name€",parameters,null); | ||
\} | ||
};separator="\n"€ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters