Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Back-End Test Task

Для реализации проекта использовались:

  • H2 data base

  • Spring boot

  • Spring Data JPA

Подключение к интерфейсу БД:

application.properties file:

server.port=8080
spring.h2.console.enabled=true
#DB
spring.datasource.url=jdbc:h2:mem:productdb
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=user
spring.datasource.password=
#JPA
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect

Выполнение запросов:

Получение товара (Просмотр всех существующих товаров по типу):

(GET-запрос)

Просмотр товара по идентификатору:

(GET-запрос)

-http://localhost:8080/products/{id} (возвращает конкретный товар по идентификатору

Добавление товара:

(POST-запрос)

Редактирование товара (заменяет только те поля, которые присутствуют в теле запроса):

(PUT-запрос)

Удаление товара:

(DELETE-запрос)

http://localhost:8080/products/{id}

Для тестирования проекта использовался Postman

Шаблоны тела запроса для добавления товаров:

Hdd:

{
        "type": "hdd",
        "serial": "355722",
        "manufacturer": "Toshiba",
        "cost": "100",
        "amount": "38",
        "capacity": "100000"
    },
    {
        "type": "hdd",
        "serial": "934324",
        "manufacturer": "IBM",
        "cost": "300",
        "amount": "5",
        "capacity": "50000"
    }

Laptop:

{
        "type": "laptop",
        "serial": "2281337",
        "manufacturer": "HP",
        "cost": "300",
        "amount": "10",
        "screenSize": "15"
    },
	{
        "type": "laptop",
        "serial": "234321",
        "manufacturer": "MSI",
        "cost": "500",
        "amount": "3",
        "screenSize": "17"
    }

Monitor:

{
        "type": "monitor",
        "serial": "77281337",
        "manufacturer": "LG",
        "cost": "150",
        "amount": "15",
        "diagonal": "21"
    },
		{
        "type": "monitor",
        "serial": "944693385",
        "manufacturer": "Xiaomi",
        "cost": "300",
        "amount": "6",
        "diagonal": "17"
    }

PC:

{
        "type": "pc",
        "serial": "10281337",
        "manufacturer": "Apple",
        "cost": "1000",
        "amount": "20",
        "pcType": "monoblock"
    },
		{
        "type": "pc",
        "serial": "944693385",
        "manufacturer": "Lenovo",
        "cost": "500",
        "amount": "6",
        "pcType": "desktop"
    }

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages