Skip to content

kauassilva/workshop-springboot3-jpa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workshop Springboot3 JPA

Description

This repository is a copy (with some changes) of the repository workshop-springboot3-jpa by acenelio made in his course Java COMPLETO 2023 Programação Orientada a Objetos +Projetos.

domain-model-diagram

domain-instance-diagram

Prerequisites

  • Java 8 or higher
  • PostgreSQL

Configuration

  1. In src/main/resources/application.properties, the default profile is test which will use the in-memory H2 database. To view the database, run the API, and type the URL in your browser: localhost:8080/h2-console.

    spring.profiles.active=test
  2. If you want to use PostgreSQL, switch the profile to dev and make the following settings:

    spring.profiles.active=dev
  3. open application-dev.properties;

  4. Create a database with the name of your preference in postgresql, and insert its URL:

    spring.datasource.url=jdbc:postgresql://localhost:5432/springboot_course
  5. Enter your username:

    spring.datasource.username=postgres
  6. Enter your password:

    spring.datasource.password=1234567

API Endpoints

Users

  • GET users: returns a list of all users.

    get-all-users

  • GET users/{id}: returns a user by id.

    get-user-by-id

  • POST users: Registers a user.

    post-user

  • DELETE users/{id}: Deletes a user by id.

    delete-user

  • PUT users/{id}: Updates the data of a user by id.

    put-user

Categories

  • GET categories: returns a list of all categories.

    get-all-categories

  • GET categories/{id}: returns a category by id.

    get-category-by-id

  • POST categories: Registers a category.

    post-category

  • DELETE categories/{id}: Deletes a category by id.

    delete-category

  • PUT categories/{id}: Updates the data of a category by id.

    put-category

Products

  • GET products: returns a list of all products.

    get-all-products

  • GET products/{id}: returns a product by id.

    get-product-by-id

Orders

  • GET orders: returns a list of all orders.

    get-all-orders

  • GET orders/{id}: returns an order by id.

    get-order-by-id

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages