/FT-Teknoloji-Spring-Boot-Practicum-First-Case

It's a shopping database. Used Technologies & Tools : Java Spring Boot, PostgreSQL, Postman

Primary LanguageJava

Shopping Database

Simple shopping database. (Java Spring Boot)

THIS SIMPLE DATABASE HAS THREE ENTITIES.

-> Product (Id, name, price, expireDate)

-> User (Id, name, surname, email, phoneNumber)

-> ProductComment (Id, comment, commentDate, productId, userId)

As you can see, our entities have relationships with each other. So we need to create relationships with annotations.

In the three entity files (model files in my project) you can see annotations referring to the relationships. Also, you can see the apis I wrote in the three controller files.

Let's take a deep look on our API's.


USAGES


1-) Get Available Products

+ localhost:8080/products/available

Lists products that are not expired. (Including null dates!)



2-) Get Expired Products

+ localhost:8080/products/expired

Lists products that are expired.



3-) Get comments between dates for given product id

+ localhost:8080/products/1/search?startDate=2020-01-01&endDate=2024-01-01

List of comments for a given product within a given date range. Has 2 query parameters.

params : startDate 2020-01-01 endDate 2024-01-01



4-) Get comments between dates for given user id

+ localhost:8080/users/2/search?startDate=2020-01-01&endDate=2024-01-01

List of comments for a given user within a given date range

params : startDate 2020-01-01 endDate 2024-01-01



5-) Get all comments for given product id

+ localhost:8080/products/1/comments

List of comments for a given product



6-) Get all comments for given user id

+ http://localhost:8080/users/2/comments

List of comments for a given user