This API features:
- A Many-To-Many and One-To-Many relationship (see diagrams)
- Derived queries for multiple end-points (see list)
- Full CRUD functionality
Diagrams
Queries
CRUD Functionality
Tests
Dependencies
Installation
The persons endpoint is located at localhost:8080/persons
and can be queried with:
- name (Case-insensitive) eg.
localhost:8080/persons?name=Vegeta
- planet (Case-insensitive) eg.
localhost:8080/persons?planet=Namek
- age (Greater than) eg.
localhost:8080/persons?age=19
- race (Case-insensitive) eg.
localhost:8080/persons?race=Human
- series (DragonBall or DragonBall_Z currently) eg.
localhost:8080/persons?series=DragonBall_Z
Any combination can be queried at the same time eg. localhost:8080/persons?name=Goku&age=15&series=DragonBall
The techniques endpoint is located at localhost:8080/techniques
and can be queried with:
- name (Case-insensitive) eg.
localhost:8080/techniques?name=Kamehameha
- type (Case-insensitive) eg.
localhost:8080/techniques?type=beam
- personName (Case-sensitive, returns techniques used by person)
eg.localhost:8080/techniques?personName=Krillin
Any combination can be queried at the same time
The sagas endpoint is located at localhost:8080/sagas
and can be queried with:
- name (Case-insensitive) eg.
localhost:8080/sagas?name=Piccolo
- releaseDate (Release date after YYYYMMDD) eg.
localhost:8080/sagas?releaseDate=20050101
- series (DragonBall and DragonBall_Z currently) eg.
localhost:8080/sagas?series=DragonBall
- personName (Case-sensitive, returns sagas person features in) eg.
localhost:8080/sagas?personName=Vegeta
Accessing each endpoint with no queries GETs all elements.
To GET an element by id use localhost:8080/{endpoint}/{id}
To POST to an endpoint use localhost:8080/{endpoint}
and pass in JSON data, if there is an element with that id an exception will be thrown
To PUT(update) an element use localhost:8080/{endpoint}/{id}
and pass in JSON data, if there is no element with that id an exception will be thrown
To DELETE an element use localhost:8080/{endpoint}/{id}
if there is no element with that id an exception will be thrown
Tests have been created for all queries
Below shows examples of tests used for all queries relating to the "persons" route
Junit and assertj for testing.
Spring Web
Spring Boot DevTools
Spring Data JPA
H2 Database
- Clone this repository :
git clone [email protected]:fred1878/Dragonball_API.git
- Access the endpoints either in browser with
localhost:8080/{endpoint}
, Postman or H2