Skip to content

SheillyR/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

Overview

Schema

Globant

Architecture

  1. Model:
  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:

Technologies

  1. Spring Boot (spring-boot-starter-web, spring-boot-starter-tomcat, spring-boot-starter-test, spring-boot-starter-data-couchbase)
  2. Java 11
  3. Tomcat 8.5.x
  4. Gradle

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

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

No packages published

Contributors 2

  •  
  •  

Languages