Banking-api

The banking-api module contains the functionality exposed by the server that will later be consumed by different application clients; the functionality will be made available for RESTful web services. Let's review the project structure for this API:

The banking-api module

As mentioned previously, this module is implemented entirely using Groovy, and that's why all of the files have a .groovy extension. The project structure is more important here, as the project is separated into balance, config, and security packages, which makes it fairly simple to understand their purposes. It's always worth organizing the code in this way, in order to make it easy to understand.

We mentioned previously that not only should an SDK be provided, but proper documentation is also highly recommended. The tedious part of writing documentation is that you need to keep it in sync with the new features added to the project. To achieve this goal, we have integrated Swagger into our application. This is a helpful tool that generates a website with examples to consume the endpoints of an application. Furthermore, it also creates payload demos for each one of them when it's required, as shown in the following screenshot:

Autogenerated Swagger UI

This portal is available at http://localhost:8080/swagger-ui.html.

Now, let's briefly review the packages listed in the screenshot for each module.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.187.223