This project is our solution to assignment 3, backend. When running the project you can perform the HTTP requests according to the lab specification, just go to the right endpoint in something like postman and perform the correct HTTP method. When an endpoint is specified and a HTTP method is performed, for example in Postman, then a controller will map to that specific endpoint, and method. What then happens is that controller will perform a HTTP request with the user of services, which uses repositories that implement JPA repository. DTOs are also used in services to expose specific data encapsulating the entity models (Character, Movie, Franchise). Mapper objects are used to map from DTO to the entity. It is often said though that a picture can say more than 1000 words and so here below is a diagram of the structure:
Here are some endpoints that can be used to test the functionality of the project.
-
Get all Characters in franchise: (GET) localhost:8080/api/v1/franchises/characters/{id}
-
Get a specific franchise: (GET) localhost:8080/api/v1/franchises/{id}.
-
Get all franchises: (GET) localhost:8080/api/v1/franchises
-
Post a franchise: (POST) localhost:8080/api/v1/franchises
-
Update a franchise: (PUT) localhost:8080/api/v1/franchises/{id}
-
Delete a franchise: (DELETE) localhost:8080/api/v1/franchises/{id}
-
Update movies in a franchise: (PUT) localhost:8080/api/v1/franchises/movies/{id}
-
Get all Movies: (GET) localhost:8080/api/v1/movies
-
Get specific Movie: (GET) localhost:8080/api/v1/movies/{id}
-
Post a new Movie: (POST) localhost:8080/api/v1/movies
-
Update a new Movie: (PUT) localhost:8080/api/v1/movies/{id}
-
Delete a Movie: (DELETE) localhost:8080/api/v1/movies/{id}
-
Update characters in Movie: (PUT) localhost:8080/api/v1/movies/characters/1
-
Get all Characters: (GET) localhost:8080/api/v1/character
-
Get a specific Character: (GET) localhost:8080/api/v1/character/{id}
-
Post a new Character: (POST) localhost:8080/api/v1/character/{id}
-
Update a Character: (PUT) localhost:8080/api/v1/characters/1
-
Delete a Character: (DELETE) localhost:8080/api/v1/characters/1
- Install Java version 17 (or later versions).
- Install Maven (you can run the command
mvn -v
to see if you have it installed). - Install SpringBoot.
- Install DBeaver or PGadmin.
- Install PostgresSQL.
- Create an account at postman (or any other similar service) to test HTTP methods like POST.
Vendela Österman
August Danell Håkansson