em-shop/API.REMOTE.rest

197 lines
3.3 KiB
ReStructuredText
Raw Normal View History

2024-11-20 11:21:36 +05:00
// REST Client for Visual Studio Code:
// https://marketplace.visualstudio.com/items?itemName=humao.rest-client
// STOCKS
// Create Product:
POST http://5.35.86.48/stocks/api/product/create
content-Type: application/json
{
"plu": 11347,
"name": "Яблоки"
}
###
// Create Shop:
POST http://5.35.86.48/stocks/api/shop/create
content-Type: application/json
{
"name": "Рынок"
}
###
// Create Stocks:
POST http://5.35.86.48/stocks/api/stocks/create
content-Type: application/json
{
"plu": 1115,
"shop_id": 4,
"in_stock": 3789,
"in_order": 5000
}
###
// Increase Stocks by plu/shop_id:
PATCH http://5.35.86.48/stocks/api/stocks/increase
content-Type: application/json
{
//"id": 5,
"plu": "1111",
"shop_id": 4,
"increase_shelf": 12,
"increase_order": 15
}
###
// [Optional] Increase Stocks by id:
PATCH http://5.35.86.48/stocks/api/stocks/increase
content-Type: application/json
{
"id": 2,
"increase_shelf": 12,
"increase_order": 15
}
###
// Decrease Stocks by plu/shop_id:
PATCH http://5.35.86.48/stocks/api/stocks/decrease
content-Type: application/json
{
// "id": 5, // Optional OR:
"plu": 1112,
"shop_id": 4,
"decrease_shelf": 12,
"decrease_order": 15
}
###
// [Optional] Decrease Stocks by id:
PATCH http://5.35.86.48/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://5.35.86.48/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://5.35.86.48/stocks/api/stocks?shop_id=4&plu=1111&page=1&page_size=1
###
// Get Products:
// plu=1111
// name=appl
// page=1
// page_size=2
// [ALL PARAMS]:
GET http://5.35.86.48/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://5.35.86.48/history/api/history?plu=1111&shop_id=1&action=create&date_from=105653336&date_to=2034634345&page=1&page_size=10
###
// [ALL]:
GET http://5.35.86.48/history/api/history?page=1&page_size=10
###
// [SANDBOX]:
GET http://5.35.86.48/history/api/history?&page=1&page_size=30&date_to=1731906190
###
//===============================================================================================================================
// Users
// Create User:
POST http://5.35.86.48/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://5.35.86.48/users/api/users/delete-all
###
// Create All Users
POST http://5.35.86.48/users/api/users/create-all
content-Type: application/json
{
"count": 1000000
}
###
// Get Users
GET http://5.35.86.48/users/api/users?page=1&pageSize=10
###
// Reset Problems:
PATCH http://5.35.86.48/users/api/users/reset-problems
###