Skip to content

emae1712/final-project-globant

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Globant

Back in the Game - Java Project 👩‍💻

CRUD Library

Index

1. Overview

2. Configuration

3. Schema

Globant

4. Architecture

  1. Model: layer where the classes that represent the tables in the database are created
  2. Controller: is the presentation layer where the end points are located
  3. Service: is the service layer where the business logic resides
  4. Repository: is the persistence layer where the CRUD repository is located
  5. Exception:
  6. Configuration:

5. Technologies

  • Spring Boot (spring-boot-starter-web, spring-boot-starter-data-jpa, spring-boot-starter-test, spring-boot-starter-validation)
  • Java 11
  • Gradle
  • JPA
  • MySQL
  • JUnit and Mockito

Tests

  1. Integration Test (for the Controller): it uses the Spring Boot Test framework with mockMvc and Jupyter
  2. Unit Test
    • for the Service: it uses the Mockito framework with hamcrest matchers, mock and injectMocks annotations
    • for the Repository:

6. Developed methods

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}

About

CRUD library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Java 100.0%