em-shop/API.rest

197 lines
3.3 KiB
ReStructuredText
Raw Normal View History

2024-11-20 09:53:03 +05:00
2024-11-20 11:21:36 +05:00
// REST Client for Visual Studio Code:
// https://marketplace.visualstudio.com/items?itemName=humao.rest-client
2024-11-20 09:53:03 +05:00
// STOCKS
// Create Product:
POST http://localhost/stocks/api/product/create
content-Type: application/json
{
"plu": 11297,
"name": "Apple"
}
###
// Create Shop:
POST http://localhost/stocks/api/shop/create
content-Type: application/json
{
"name": "Магнит"
}
###
// Create Stocks:
POST http://localhost/stocks/api/stocks/create
content-Type: application/json
{
"plu": 1111,
"shop_id": 4,
"in_stock": 3789,
"in_order": 5000
}
###
// Increase Stocks by plu/shop_id:
PATCH http://localhost/stocks/api/stocks/increase
content-Type: application/json
{
//"id": 5,
"plu": "1111",
"shop_id": 1,
"increase_shelf": 12,
"increase_order": 15
}
###
// [Optional] Increase Stocks by id:
PATCH http://localhost/stocks/api/stocks/increase
content-Type: application/json
{
"id": 2,
"increase_shelf": 12,
"increase_order": 15
}
###
// Decrease Stocks by plu/shop_id:
PATCH http://localhost/stocks/api/stocks/decrease
content-Type: application/json
{
// "id": 5, // Optional OR:
"plu": 1112,
"shop_id": 3,
"decrease_shelf": 12,
"decrease_order": 15
}
###
// [Optional] Decrease Stocks by id:
PATCH http://localhost/stocks/api/stocks/decrease
content-Type: application/json
{
"id": 1,
"decrease_shelf": 12,
"decrease_order": 15
}
###
// Get Stocks:
// plu=1111
// shop_id=1
// shelf_from=0
// shelf_to=3800
// order_from=0
// order_to=10000
// page=1
// page_size=2
// [ALL PARAMS]:
GET http://localhost/stocks/api/stocks?plu=1111&shop_id=1&shelf_from=0&shelf_to=3800&order_from=0&order_to=10000&page=1&page_size=2
###
// [SANDBOX]:
GET http://localhost/stocks/api/stocks?shop_id=1&page=1&page_size=1
###
// Get Products:
// plu=1111
// name=appl
// page=1
// page_size=2
// [ALL PARAMS]:
GET http://localhost/stocks/api/products?plu=&name=ябл&page=1&page_size=2
###
//===============================================================================================================================
// Service 2
// Get History:
// plu=1111
// shop_id=1
// action=decreaseStocks
// date_from=1731906196 (Unix Timestamp)
// date_to=1731906196
// page=1
// page_size=3
// [ALL PARAMS]:
GET http://localhost/history/api/history?plu=1111&shop_id=1&action=create&date_from=105653336&date_to=2034634345&page=1&page_size=10
###
// [ALL]:
GET http://localhost/history/api/history?page=1&page_size=10
###
// [SANDBOX]:
GET http://localhost/history/api/history?&page=1&page_size=30&date_to=1731906190
###
//===============================================================================================================================
// Users
// Create User:
POST http://localhost/users/api/users/create
content-Type: application/json
{
"firstName": "Иван",
"lastName": "Иванов",
"birthday": "2006-11-19 19:00:00.000 +00:00",
"sex": 1,
"problems": true
}
###
// Delete All Users
DELETE http://localhost/users/api/users/delete-all
###
// Create All Users
POST http://localhost/users/api/users/create-all
content-Type: application/json
{
"count": 1000000
}
###
// Get Users
GET http://localhost/users/api/users?page=1&pageSize=10
###
// Reset Problems:
PATCH http://localhost/users/api/users/reset-problems
###