Modify an EGL Client Interface
Once the generated code from the Client Interface is ready to use in other structures.
Note:
If required, change the output code with your business logic in the generated
file.
Following is an example of a generated output code from the Client Interface process:
package interfaces;
interface firstInterf{
description = "Description of the first path"
}
function findByTagsFunction(tags string? in){
tags = [ "tag"],
description = "Get an object using a tag",
@GetRest {
uriTemplate = "/random/findByTags?tags={tags}",
requestFormat = JSON,
responses = [
@RestResponse{
statusCode = 200,
description = "successful operation"
responseFormat = XML
}]
}
};
end
Following is an example of use of the previously generated code in a Service MyService
that implements the interface firstInterf:
package services;
import interfaces.firstInterf;
service MyService implements firstInterf{
Title = "Title of the Service",
description = "Description of the Service",
version = "0.1.2" }
function findByTagsFunction(tags string? in){
tags = [ "tag"],
description = "Get an object using a tag",
@GetRest {
uriTemplate = "/random/findByTags?tags={tags}",
requestFormat = JSON,
responses = [
@RestResponse{
statusCode = 200,
description = "successful operation"
responseFormat = XML
}]
}
};
// You business logic goes here...
end
end