CRUD Library
- 1. Resumen del proyecto
- 2. Definición del producto
- 3. Historias de usuario
- 4. Diseño de Interfaz de Usuario
- 5. Test de usabilidad
- 6. Objetivos de aprendizaje
- Model:
- Controller: is the presentation layer where the end points are located
- Service: is the service layer where the business logic resides
- Repository: is the persistence layer where the CRUD repository is located
- Exception:
- Configuration:
- Spring Boot (spring-boot-starter-web, spring-boot-starter-tomcat, spring-boot-starter-test, spring-boot-starter-data-couchbase)
- Java 11
- Tomcat 8.5.x
- Gradle
- Integration Test (for the Controller): it uses the Spring Boot Test framework with mockMvc and Jupyter
- Unit Test (for the Service): it uses the Mockito framework with hamcrest matchers, mock and injectMocks annotations
http://localhost:8081/api/book
HTTP Method: GET
Get all books
http://localhost:8081/api/book/getAllBooks
Get book by Id
http://localhost:8081/api/book/getBookById/{bookId}
Get books by State
http://localhost:8081/api/book/getBookByState/{state}
HTTP Method: POST
Create book
http://localhost:8080/api/book/createBook
{
"title": "Title A",
"author": "Anonymous",
"editorialYear": 2000,
"state": "AVAILABLE",
"reservation": null
}
HTTP Method: PUT
Update book by Id
http://localhost:8080/api/book/updateBook/{bookId}
{
"title": "Title B",
"author": "Somebody",
"editorialYear": 2021,
"state": "AVAILABLE",
"reservation": null
}
Update reservation by book Id
http://localhost:8080/api/book/updateReservationByBookId/{bookId}
{
"startDate": "10-05-2021",
"endDate": "26-06-2021"
}
HTTP Method: DELETE
Delete book by Id
http://localhost:8081/api/book/deleteBookById/{bookId}