forked from bro-students/multy-stub
Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18b63bed21 | ||
|
|
707c3be3ec | ||
|
|
3d52ef9d4c | ||
|
|
42944af2d3 | ||
|
|
f0f6b78cd0 | ||
|
|
7c35f17008 | ||
|
|
0208e29ae3 | ||
|
|
4d5cd104ad | ||
|
|
6702473053 | ||
|
|
52083097a2 | ||
|
|
f7ac265e3b | ||
|
|
d46841c21f | ||
|
|
c95b015094 | ||
|
|
940349af29 | ||
|
|
268824c108 | ||
|
|
550554a7a5 | ||
|
|
f5a8585845 | ||
|
|
1e67f25066 |
No files matched your search
+1
-1
@@ -3,4 +3,4 @@
|
|||||||
docker stop ms-mongo
|
docker stop ms-mongo
|
||||||
docker volume remove ms_volume
|
docker volume remove ms_volume
|
||||||
docker volume create ms_volume
|
docker volume create ms_volume
|
||||||
docker run --rm -v ms_volume:/data/db --name ms-mongo -p 27017:27017 -d mongo:4.4.13
|
docker run --rm -v ms_volume:/data/db --name ms-mongo -p 27017:27017 -d mongo:8.0.3
|
||||||
+5
-4
@@ -1,18 +1,19 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
ms_volume:
|
ms_volume8:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
mongoDb:
|
mongoDb:
|
||||||
image: mongo:4.4.13
|
image: mongo:8.0.3
|
||||||
volumes:
|
volumes:
|
||||||
- ms_volume:/data/db
|
- ms_volume8:/data/db
|
||||||
restart: always
|
restart: always
|
||||||
# ports:
|
# ports:
|
||||||
# - 27017:27017
|
# - 27017:27017
|
||||||
multy-stubs:
|
multy-stubs:
|
||||||
build: .
|
# build: .
|
||||||
|
image: bro.js/ms/bh:$TAG
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 8044:8044
|
- 8044:8044
|
||||||
|
|||||||
@@ -44,6 +44,12 @@ app.use(require('./root'))
|
|||||||
*/
|
*/
|
||||||
app.use('/epja-2024-1', require('./routers/epja-2024-1'))
|
app.use('/epja-2024-1', require('./routers/epja-2024-1'))
|
||||||
app.use('/todo', require('./routers/todo/routes'))
|
app.use('/todo', require('./routers/todo/routes'))
|
||||||
|
app.use('/dogsitters-finder', require('./routers/dogsitters-finder'))
|
||||||
|
app.use('/kazan-explore', require('./routers/kazan-explore'))
|
||||||
|
app.use('/edateam', require('./routers/edateam-legacy'))
|
||||||
|
app.use('/dry-wash', require('./routers/dry-wash'))
|
||||||
|
app.use('/freetracker', require('./routers/freetracker'))
|
||||||
|
app.use('/dhs-testing', require('./routers/dhs-testing'))
|
||||||
|
|
||||||
app.use(require('./error'))
|
app.use(require('./error'))
|
||||||
|
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,35 @@
|
|||||||
|
const router = require('express').Router();
|
||||||
|
|
||||||
|
router.get("/users", (request, response) => {
|
||||||
|
response.send(require("./json/users/users.json"))
|
||||||
|
})
|
||||||
|
|
||||||
|
router.post("/auth", (request, response) => {
|
||||||
|
const {phoneNumber, password} = request.body;
|
||||||
|
console.log(phoneNumber, password);
|
||||||
|
if (phoneNumber === '89999999999') {
|
||||||
|
response.send(require("./json/auth/dogsitter.success.json"))
|
||||||
|
}
|
||||||
|
else if (phoneNumber === '89555555555') {
|
||||||
|
response.status(400).send(require("./json/auth/error.json"))
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
response.send(require("./json/auth/owner.success.json"))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
router.post("/register", (request, response) => {
|
||||||
|
const {firstName, secondName, phoneNumber, password, role} = request.body;
|
||||||
|
console.log(phoneNumber, password, role);
|
||||||
|
if (phoneNumber === '89283244141' || phoneNumber === '89872855893') {
|
||||||
|
response.status(400).send(require("./json/register/error.json"))
|
||||||
|
}
|
||||||
|
else if (role === 'dogsitter') {
|
||||||
|
response.send(require("./json/register/dogsitter.success.json"))
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
response.send(require("./json/register/owner.success.json"))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
module.exports = router;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"id": 1,
|
||||||
|
"phoneNumber": 89283244141,
|
||||||
|
"firstName": "Вася",
|
||||||
|
"secondName": "Пупкин",
|
||||||
|
"role": "dogsitter",
|
||||||
|
"location": "Россия, республика Татарстан, Казань, улица Пушкина, 12",
|
||||||
|
"price": 1500,
|
||||||
|
"aboutMe": "Я люблю собак"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"error": "Пользователь не найден"
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"id": 3,
|
||||||
|
"phoneNumber": 89872855893,
|
||||||
|
"firstName": "Гадий",
|
||||||
|
"secondName": "Петрович",
|
||||||
|
"role": "owner"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"id": 5,
|
||||||
|
"phoneNumber": 89555555555,
|
||||||
|
"firstName": "Масяня",
|
||||||
|
"secondName": "Карлова",
|
||||||
|
"role": "dogsitter",
|
||||||
|
"location": "Россия, республика Татарстан, Казань, улица Пушкина, 12",
|
||||||
|
"price": 100,
|
||||||
|
"aboutMe": "Все на свете - собаки"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"error": "Пользователь с таким номером телефона уже существует"
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"id": 6,
|
||||||
|
"phoneNumber": 89888888888,
|
||||||
|
"firstName": "Генадий",
|
||||||
|
"secondName": "Паровозов",
|
||||||
|
"role": "owner"
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-5
@@ -2,7 +2,6 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"phone_number": 89283244141,
|
"phone_number": 89283244141,
|
||||||
"password": "1234",
|
|
||||||
"first_name": "Вася",
|
"first_name": "Вася",
|
||||||
"second_name": "Пупкин",
|
"second_name": "Пупкин",
|
||||||
"role": "dogsitter",
|
"role": "dogsitter",
|
||||||
@@ -13,7 +12,6 @@
|
|||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"phone_number": 89272844541,
|
"phone_number": 89272844541,
|
||||||
"password": "1234",
|
|
||||||
"first_name": "Ваня",
|
"first_name": "Ваня",
|
||||||
"second_name": "Пуськин",
|
"second_name": "Пуськин",
|
||||||
"role": "dogsitter",
|
"role": "dogsitter",
|
||||||
@@ -24,7 +22,6 @@
|
|||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"phone_number": 89872855893,
|
"phone_number": 89872855893,
|
||||||
"password": "12345",
|
|
||||||
"first_name": "Гадий",
|
"first_name": "Гадий",
|
||||||
"second_name": "Петрович",
|
"second_name": "Петрович",
|
||||||
"role": "owner"
|
"role": "owner"
|
||||||
@@ -32,10 +29,9 @@
|
|||||||
{
|
{
|
||||||
"id": 4,
|
"id": 4,
|
||||||
"phone_number": 89872844591,
|
"phone_number": 89872844591,
|
||||||
"password": "12345",
|
|
||||||
"first_name": "Галкин",
|
"first_name": "Галкин",
|
||||||
"second_name": "Максим",
|
"second_name": "Максим",
|
||||||
"role": ["owner", "dogsitter"],
|
"role": "dogsitter",
|
||||||
"location": "Россия, республика Татарстан, Казань, проспект Ямашева, 83",
|
"location": "Россия, республика Татарстан, Казань, проспект Ямашева, 83",
|
||||||
"price": 1000000,
|
"price": 1000000,
|
||||||
"about_me": "Миллион алых роз"
|
"about_me": "Миллион алых роз"
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
const router = require('express').Router()
|
||||||
|
|
||||||
|
router.get('/arm/masters', (req, res) => {
|
||||||
|
res
|
||||||
|
.status(200)
|
||||||
|
.send(require("./json/arm-masters/success.json"))
|
||||||
|
})
|
||||||
|
|
||||||
|
router.get('/arm/orders', (req, res) => {
|
||||||
|
res
|
||||||
|
.status(200)
|
||||||
|
.send(require(`./json/arm-orders/success.json`))
|
||||||
|
})
|
||||||
|
|
||||||
|
module.exports = router
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"body": [
|
||||||
|
{
|
||||||
|
"id": "masters1",
|
||||||
|
"name": "Иван Иванов",
|
||||||
|
"schedule": [ {
|
||||||
|
"id": "order1",
|
||||||
|
"startWashTime": "2024-11-24T10:30:00.000Z",
|
||||||
|
"endWashTime": "2024-11-24T16:30:00.000Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "order2",
|
||||||
|
"startWashTime": "2024-11-24T11:30:00.000Z",
|
||||||
|
"endWashTime": "2024-11-24T17:30:00.000Z"
|
||||||
|
}],
|
||||||
|
"phone": "+7 900 123 45 67"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "masters12",
|
||||||
|
"name": "Иван Иванов",
|
||||||
|
"schedule": [ {
|
||||||
|
"id": "order1",
|
||||||
|
"startWashTime": "2024-11-24T10:30:00.000Z",
|
||||||
|
"endWashTime": "2024-11-24T16:30:00.000Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "order2",
|
||||||
|
"startWashTime": "2024-11-24T11:30:00.000Z",
|
||||||
|
"endWashTime": "2024-11-24T17:30:00.000Z"
|
||||||
|
}],
|
||||||
|
"phone": "+7 900 123 45 67"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"body": [
|
||||||
|
{
|
||||||
|
"id": "order1",
|
||||||
|
"carNumber": "A123BC",
|
||||||
|
"startWashTime": "2024-11-24T10:30:00.000Z",
|
||||||
|
"endWashTime": "2024-11-24T16:30:00.000Z",
|
||||||
|
"orderDate": "2024-11-24T08:41:46.366Z",
|
||||||
|
"status": "progress",
|
||||||
|
"phone": "79001234563",
|
||||||
|
"location": "Казань, ул. Баумана, 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "order2",
|
||||||
|
"carNumber": "A245BC",
|
||||||
|
"startWashTime": "2024-11-24T11:30:00.000Z",
|
||||||
|
"endWashTime": "2024-11-24T17:30:00.000Z",
|
||||||
|
"orderDate": "2024-11-24T07:40:46.366Z",
|
||||||
|
"status": "progress",
|
||||||
|
"phone": "79001234567",
|
||||||
|
"location": "Казань, ул. Баумана, 43"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
const router = require('express').Router();
|
||||||
|
|
||||||
|
router.get('/recipe-data', (request, response) => {
|
||||||
|
response.send(require('./json/recipe-data/success.json'))
|
||||||
|
})
|
||||||
|
|
||||||
|
router.get('/userpage-data', (req, res)=>{
|
||||||
|
res.send(require('./json/userpage-data/success.json'))
|
||||||
|
})
|
||||||
|
|
||||||
|
router.get('/homepage-data', (req, res)=>{
|
||||||
|
res.send(require('./json/homepage-data/success.json'))
|
||||||
|
})
|
||||||
|
|
||||||
|
module.exports = router;
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
{
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"src": "pancakes_meat",
|
||||||
|
"alt": "Фотография блинчиков с мясом, сыром и луком",
|
||||||
|
"href": "?=dish01",
|
||||||
|
"name": "Блинчики с мясом, сыром и лучком",
|
||||||
|
"category": [
|
||||||
|
"Ужины"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "cheesecakes",
|
||||||
|
"alt": "Фотография сырников из творога",
|
||||||
|
"href": "?=dish02",
|
||||||
|
"name": "Сырники из творога",
|
||||||
|
"category": [
|
||||||
|
"Завтраки"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "borsch",
|
||||||
|
"alt": "Фотография борща",
|
||||||
|
"href": "?=dish03",
|
||||||
|
"name": "Борщ",
|
||||||
|
"category": [
|
||||||
|
"Супы"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "vareniki",
|
||||||
|
"alt": "Фотография вареников",
|
||||||
|
"href": "?=dish04",
|
||||||
|
"name": "Ленивые вареники",
|
||||||
|
"category": [
|
||||||
|
"Ужины"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "rice_porridge",
|
||||||
|
"alt": "Фотография рисовой каши",
|
||||||
|
"href": "?=dish05",
|
||||||
|
"name": "Рисовая каша",
|
||||||
|
"category": [
|
||||||
|
"Завтраки"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "cutlets",
|
||||||
|
"alt": "Фотография котлет по-киевски",
|
||||||
|
"href": "?=dish06",
|
||||||
|
"name": "Котлеты по-киевски",
|
||||||
|
"category": [
|
||||||
|
"Обеды"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "draniki",
|
||||||
|
"alt": "Фотография драников",
|
||||||
|
"href": "?=dish07",
|
||||||
|
"name": "Драники",
|
||||||
|
"category": [
|
||||||
|
"Обеды"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "meringue",
|
||||||
|
"alt": "Фотография безе",
|
||||||
|
"href": "?=dish08",
|
||||||
|
"name": "Безе",
|
||||||
|
"category": [
|
||||||
|
"Выпечка и десерты"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "goulash",
|
||||||
|
"alt": "Фотография гуляша",
|
||||||
|
"href": "?=dish09",
|
||||||
|
"name": "Гуляш",
|
||||||
|
"category": [
|
||||||
|
"Мясо"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "pancakes_cherries",
|
||||||
|
"alt": "Фотография блинчиков с вишней и творожным сыром",
|
||||||
|
"href": "?=dish10",
|
||||||
|
"name": "Блинчики с вишней и творожным сыром",
|
||||||
|
"category": [
|
||||||
|
"Завтраки"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "canned_soup",
|
||||||
|
"alt": "Фотография супа из рыбных консервов",
|
||||||
|
"href": "?=dish11",
|
||||||
|
"name": "Суп из рыбных консервов",
|
||||||
|
"category": [
|
||||||
|
"Супы"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "salad",
|
||||||
|
"alt": "Фотография салата",
|
||||||
|
"href": "?=dish12",
|
||||||
|
"name": "Салат \"Весенний\"",
|
||||||
|
"category": [
|
||||||
|
"Салаты"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"name":"Блинчики с вишней и творожным сыром",
|
||||||
|
|
||||||
|
"stages":
|
||||||
|
[
|
||||||
|
"Смешать муку, молоко, яйца, сахар и соль в миске",
|
||||||
|
"Добавить вишню в тесто и перемешать",
|
||||||
|
"Вылить тесто на разогретую сковороду и обжарить с двух сторон до золотистого цвета",
|
||||||
|
"Подавать блинчики, украсив творожным сыром сверху"
|
||||||
|
],
|
||||||
|
|
||||||
|
"table":
|
||||||
|
[
|
||||||
|
{ "ingredient": "1",
|
||||||
|
"weight": "500 гр",
|
||||||
|
"price1": "500р.",
|
||||||
|
"price2": "439р.",
|
||||||
|
"price3": "600р." },
|
||||||
|
|
||||||
|
{ "ingredient": "Ингредиент 2",
|
||||||
|
"weight": "2 шт",
|
||||||
|
"price1": "120р.",
|
||||||
|
"price2": "150р.",
|
||||||
|
"price3": "130р." },
|
||||||
|
|
||||||
|
{ "ingredient": "Ингредиент 3",
|
||||||
|
"weight": "500 гр",
|
||||||
|
"price1": "12р.",
|
||||||
|
"price2": "12.99р.",
|
||||||
|
"price3": "10р." },
|
||||||
|
|
||||||
|
{ "ingredient": "Ингредиент 4",
|
||||||
|
"weight": "500 гр",
|
||||||
|
"price1": "500р.",
|
||||||
|
"price2": "439р.",
|
||||||
|
"price3": "600р." },
|
||||||
|
|
||||||
|
{ "ingredient": "Ингредиент 5",
|
||||||
|
"weight": "500 гр",
|
||||||
|
"price1": "500р.",
|
||||||
|
"price2": "439р.",
|
||||||
|
"price3": "600р." },
|
||||||
|
|
||||||
|
{ "ingredient": "Ингредиент 6",
|
||||||
|
"weight": "500 гр",
|
||||||
|
"price1": "500р.",
|
||||||
|
"price2": "439р.",
|
||||||
|
"price3": "600р." }
|
||||||
|
],
|
||||||
|
|
||||||
|
"tags":
|
||||||
|
[
|
||||||
|
{ "name": "#блины", "href": "#01" },
|
||||||
|
{ "name": "#вишня", "href": "#02" },
|
||||||
|
{ "name": "#молоко"," href": "#03" }
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"data":{
|
||||||
|
"id":1,
|
||||||
|
"loginname":"Логин пользователя",
|
||||||
|
"datesignin":"2024/05/18",
|
||||||
|
"favoritedishes":
|
||||||
|
[
|
||||||
|
{"id":1,
|
||||||
|
"dishlink":"?=dish1",
|
||||||
|
"dishname":"Блюдо1"
|
||||||
|
},
|
||||||
|
{"id":2,
|
||||||
|
"dishlink":"?=dish2",
|
||||||
|
"dishname":"Блюдо2"
|
||||||
|
},
|
||||||
|
{"id":3,
|
||||||
|
"dishlink":"?=dish3",
|
||||||
|
"dishname":"Блюдо3"
|
||||||
|
},
|
||||||
|
{"id":4,
|
||||||
|
"dishlink":"?=dish4",
|
||||||
|
"dishname":"Блюдо4"
|
||||||
|
},
|
||||||
|
{"id":5,
|
||||||
|
"dishlink":"?=dish5",
|
||||||
|
"dishname":"Блюдо5"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,4 @@ router.use('/cats', require('./cats/index'))
|
|||||||
|
|
||||||
router.use('/ecliptica', require('./ecliptica/index'))
|
router.use('/ecliptica', require('./ecliptica/index'))
|
||||||
|
|
||||||
router.use('/sdk', require('./sdk/index'))
|
|
||||||
|
|
||||||
module.exports = router
|
module.exports = router
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
const router = require('express').Router();
|
|
||||||
const { v4: uuidv4 } = require('uuid');
|
|
||||||
|
|
||||||
const workout1 = {
|
|
||||||
id: uuidv4(),
|
|
||||||
title: "Toned upper body",
|
|
||||||
exercises: [
|
|
||||||
{ title: "Push ups", repsOrDuration: 12, isTimeBased: false },
|
|
||||||
{ title: "Plank", repsOrDuration: 4, isTimeBased: true },
|
|
||||||
{ title: "Bicep curl", repsOrDuration: 12, isTimeBased: false, weight: 5 },
|
|
||||||
{ title: "Bicep curl", repsOrDuration: 12, isTimeBased: false, weight: 5 },
|
|
||||||
{ title: "Bicep curl", repsOrDuration: 12, isTimeBased: false, weight: 5 },
|
|
||||||
{ title: "Bicep curl", repsOrDuration: 12, isTimeBased: false, weight: 5 },
|
|
||||||
],
|
|
||||||
tags: ['Weights', 'Arms', 'Abs', 'Chest', 'Back']
|
|
||||||
};
|
|
||||||
|
|
||||||
const workout2 = {
|
|
||||||
id: uuidv4(),
|
|
||||||
title: "Tom Platz's legs",
|
|
||||||
exercises: [
|
|
||||||
{ title: "Squats", repsOrDuration: 12, isTimeBased: false, weight: 40 },
|
|
||||||
{ title: "Leg Press", repsOrDuration: 4, isTimeBased: false, weight: 65 },
|
|
||||||
{ title: "Lunges", repsOrDuration: 2, isTimeBased: true }
|
|
||||||
],
|
|
||||||
tags: ['Weights', 'Legs']
|
|
||||||
};
|
|
||||||
|
|
||||||
const workout3 = {
|
|
||||||
id: uuidv4(),
|
|
||||||
title: "HIIT",
|
|
||||||
exercises: [
|
|
||||||
{ title: "Jumping rope", repsOrDuration: 100, isTimeBased: false },
|
|
||||||
{ title: "Burpees", repsOrDuration: 3, isTimeBased: true },
|
|
||||||
{ title: "Jumping Jacks", repsOrDuration: 50, isTimeBased: false }
|
|
||||||
],
|
|
||||||
tags: ['Cardio']
|
|
||||||
}
|
|
||||||
|
|
||||||
const savedWorkouts = [workout1, workout3];
|
|
||||||
|
|
||||||
const trainingWorkouts = [workout2];
|
|
||||||
|
|
||||||
router.post('/workout', (req, res) => {
|
|
||||||
const newWorkout = { ...req.body, id: uuidv4() };
|
|
||||||
savedWorkouts.push(newWorkout);
|
|
||||||
res.status(201).json(newWorkout);
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get('/workouts', (req, res) => {
|
|
||||||
res.json(savedWorkouts);
|
|
||||||
});
|
|
||||||
|
|
||||||
router.post('/training/workout', (req, res) => {
|
|
||||||
const newWorkout = { ...req.body, id: uuidv4() };
|
|
||||||
trainingWorkouts.push(newWorkout);
|
|
||||||
res.status(201).json(newWorkout);
|
|
||||||
});
|
|
||||||
|
|
||||||
const trainings = [{ id: uuidv4(), calories: 450, date: new Date("Thu Oct 03 2024 10:05:24 GMT+0300 (Moscow Standard Time)"), emoji: "fuzzy", hours: 1, minutes: 30, isWorkoutSaved: true, workout: workout1.id }];
|
|
||||||
|
|
||||||
const days = [
|
|
||||||
new Date("Thu Oct 03 2024 10:05:24 GMT+0300 (Moscow Standard Time)"),
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
router.post('/training', (req, res) => {
|
|
||||||
const newTraining = { ...req.body, id: uuidv4() };
|
|
||||||
trainings.push(newTraining);
|
|
||||||
days.push(newTraining.date);
|
|
||||||
res.status(201).json(newTraining);
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get('/training', (req, res) => {
|
|
||||||
const { date } = req.query;
|
|
||||||
if (!date) {
|
|
||||||
return res.status(400).json({ message: 'Date query parameter is required' });
|
|
||||||
}
|
|
||||||
const formattedDate = new Date(date);
|
|
||||||
const result = trainings.find(t => new Date(t.date).toDateString() === formattedDate.toDateString());
|
|
||||||
if (result) {
|
|
||||||
res.json(result);
|
|
||||||
} else {
|
|
||||||
res.status(404).json({ message: 'Training not found for the specified date' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get('/training/workout', (req, res) => {
|
|
||||||
const { id } = req.query;
|
|
||||||
if (!id) {
|
|
||||||
return res.status(400).json({ message: 'Id query parameter is required' });
|
|
||||||
}
|
|
||||||
const result = trainingWorkouts.find(w => w.id === id);
|
|
||||||
if (result) {
|
|
||||||
res.json(result);
|
|
||||||
} else {
|
|
||||||
res.status(404).json({ message: 'Training with such workout not found' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get('/workout', (req, res) => {
|
|
||||||
const { id } = req.query;
|
|
||||||
if (!id) {
|
|
||||||
return res.status(400).json({ message: 'Id query parameter is required' });
|
|
||||||
}
|
|
||||||
const result = savedWorkouts.find(w => w.id === id);
|
|
||||||
if (result) {
|
|
||||||
res.json(result);
|
|
||||||
} else {
|
|
||||||
res.status(404).json({ message: 'Workout not found' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get('/trainings', (req, res) => {
|
|
||||||
res.json(trainings);
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get('/days', (req, res) => {
|
|
||||||
res.json(days);
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = router;
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
const Router = require('express').Router;
|
||||||
|
|
||||||
|
const router = Router()
|
||||||
|
|
||||||
|
const timer = (_req, _res, next) => {
|
||||||
|
setTimeout(() => next(), 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
router.use(timer)
|
||||||
|
|
||||||
|
router.get(
|
||||||
|
'/active',
|
||||||
|
(req, res) =>
|
||||||
|
res.send(require(`./json/active-order-success.json`))
|
||||||
|
)
|
||||||
|
|
||||||
|
router.get(
|
||||||
|
'/history',
|
||||||
|
(req, res) =>
|
||||||
|
res.send(require(`./json/history-success.json`))
|
||||||
|
)
|
||||||
|
|
||||||
|
module.exports = router
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"success": false,
|
||||||
|
"errors": [
|
||||||
|
"Не получилось получить заказ с id = 123123"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"body": {
|
||||||
|
"id": "1212",
|
||||||
|
"createdAt": "2024-11-29 13:24:08",
|
||||||
|
"updatedAt": "2024-11-29 13:24:10",
|
||||||
|
"status": "in_progress",
|
||||||
|
"timeline": [
|
||||||
|
{
|
||||||
|
"color": "gray",
|
||||||
|
"children": "Москва"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": "Владимир, 25.10.2024 18:02"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": "Нижний новгород, 25.10.2024 12:21"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": "Казань, 25.10.2024 03:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"statistics": [
|
||||||
|
{
|
||||||
|
"key": "address-from",
|
||||||
|
"value": "г. Казань, ул Ильи Давыдова, стр. 87а"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "address-to",
|
||||||
|
"value": "г. Москва, ул. Тверская, д. 12"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "delivery",
|
||||||
|
"value": "26.10.2024 23:08"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "cost",
|
||||||
|
"value": "100500₽"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "customer",
|
||||||
|
"value": "ООО \"Сидоров\""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"success": false,
|
||||||
|
"body": {
|
||||||
|
"history": []
|
||||||
|
},
|
||||||
|
"errors": [
|
||||||
|
"Что-то пошло не так"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"body": {
|
||||||
|
"history": [
|
||||||
|
{
|
||||||
|
"key": 1,
|
||||||
|
"number": "12324",
|
||||||
|
"cost": 15000,
|
||||||
|
"dateEnd": 1685998800000,
|
||||||
|
"customer": "ООО \"Иванов\"",
|
||||||
|
"cityFrom": "Псков",
|
||||||
|
"cityTo": "Мурманск"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 2,
|
||||||
|
"number": "12323",
|
||||||
|
"cost": 10000,
|
||||||
|
"dateEnd": 1686085200000,
|
||||||
|
"customer": "ООО \"Попов\"",
|
||||||
|
"cityFrom": "Астрахань",
|
||||||
|
"cityTo": "Ставрополь"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 3,
|
||||||
|
"number": "12325",
|
||||||
|
"cost": 12000,
|
||||||
|
"dateEnd": 1686171600000,
|
||||||
|
"customer": "ООО \"Сидоров\"",
|
||||||
|
"cityFrom": "Москва",
|
||||||
|
"cityTo": "Казань"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 4,
|
||||||
|
"number": "12326",
|
||||||
|
"cost": 9000,
|
||||||
|
"dateEnd": 1686258000000,
|
||||||
|
"customer": "ООО \"Петров\"",
|
||||||
|
"cityFrom": "Новосибирск",
|
||||||
|
"cityTo": "Томск"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 5,
|
||||||
|
"number": "12327",
|
||||||
|
"cost": 13000,
|
||||||
|
"dateEnd": 1686344400000,
|
||||||
|
"customer": "ООО \"Смирнов\"",
|
||||||
|
"cityFrom": "Омск",
|
||||||
|
"cityTo": "Тюмень"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 6,
|
||||||
|
"number": "12328",
|
||||||
|
"cost": 14000,
|
||||||
|
"dateEnd": 1686430800000,
|
||||||
|
"customer": "ООО \"Кузнецов\"",
|
||||||
|
"cityFrom": "Саратов",
|
||||||
|
"cityTo": "Самара"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 7,
|
||||||
|
"number": "12329",
|
||||||
|
"cost": 11000,
|
||||||
|
"dateEnd": 1686517200000,
|
||||||
|
"customer": "ООО \"Васильев\"",
|
||||||
|
"cityFrom": "Краснодар",
|
||||||
|
"cityTo": "Сочи"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 8,
|
||||||
|
"number": "12330",
|
||||||
|
"cost": 8000,
|
||||||
|
"dateEnd": 1686603600000,
|
||||||
|
"customer": "ООО \"Зайцев\"",
|
||||||
|
"cityFrom": "Пермь",
|
||||||
|
"cityTo": "Екатеринбург"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 9,
|
||||||
|
"number": "12331",
|
||||||
|
"cost": 7000,
|
||||||
|
"dateEnd": 1686690000000,
|
||||||
|
"customer": "ООО \"Морозов\"",
|
||||||
|
"cityFrom": "Челябинск",
|
||||||
|
"cityTo": "Уфа"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 10,
|
||||||
|
"number": "12332",
|
||||||
|
"cost": 16000,
|
||||||
|
"dateEnd": 1686776400000,
|
||||||
|
"customer": "ООО \"Павлов\"",
|
||||||
|
"cityFrom": "Волгоград",
|
||||||
|
"cityTo": "Ростов-на-Дону"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 11,
|
||||||
|
"number": "12333",
|
||||||
|
"cost": 9000,
|
||||||
|
"dateEnd": 1686862800000,
|
||||||
|
"customer": "ООО \"Фролов\"",
|
||||||
|
"cityFrom": "Калининград",
|
||||||
|
"cityTo": "Смоленск"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 12,
|
||||||
|
"number": "12334",
|
||||||
|
"cost": 15500,
|
||||||
|
"dateEnd": 1686949200000,
|
||||||
|
"customer": "ООО \"Богданов\"",
|
||||||
|
"cityFrom": "Нижний Новгород",
|
||||||
|
"cityTo": "Киров"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 13,
|
||||||
|
"number": "12335",
|
||||||
|
"cost": 13500,
|
||||||
|
"dateEnd": 1687035600000,
|
||||||
|
"customer": "ООО \"Григорьев\"",
|
||||||
|
"cityFrom": "Тверь",
|
||||||
|
"cityTo": "Ярославль"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 14,
|
||||||
|
"number": "12336",
|
||||||
|
"cost": 12500,
|
||||||
|
"dateEnd": 1687122000000,
|
||||||
|
"customer": "ООО \"Дмитриев\"",
|
||||||
|
"cityFrom": "Сургут",
|
||||||
|
"cityTo": "Ханты-Мансийск"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 15,
|
||||||
|
"number": "12337",
|
||||||
|
"cost": 14500,
|
||||||
|
"dateEnd": 1687208400000,
|
||||||
|
"customer": "ООО \"Михайлов\"",
|
||||||
|
"cityFrom": "Иркутск",
|
||||||
|
"cityTo": "Братск"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 16,
|
||||||
|
"number": "12338",
|
||||||
|
"cost": 10500,
|
||||||
|
"dateEnd": 1687294800000,
|
||||||
|
"customer": "ООО \"Романов\"",
|
||||||
|
"cityFrom": "Владивосток",
|
||||||
|
"cityTo": "Хабаровск"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 17,
|
||||||
|
"number": "12339",
|
||||||
|
"cost": 9500,
|
||||||
|
"dateEnd": 1687381200000,
|
||||||
|
"customer": "ООО \"Федоров\"",
|
||||||
|
"cityFrom": "Якутск",
|
||||||
|
"cityTo": "Магадан"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 18,
|
||||||
|
"number": "12340",
|
||||||
|
"cost": 8500,
|
||||||
|
"dateEnd": 1687467600000,
|
||||||
|
"customer": "ООО \"Жуков\"",
|
||||||
|
"cityFrom": "Симферополь",
|
||||||
|
"cityTo": "Севастополь"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 19,
|
||||||
|
"number": "12341",
|
||||||
|
"cost": 11500,
|
||||||
|
"dateEnd": 1687554000000,
|
||||||
|
"customer": "ООО \"Николаев\"",
|
||||||
|
"cityFrom": "Барнаул",
|
||||||
|
"cityTo": "Бийск"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 20,
|
||||||
|
"number": "12342",
|
||||||
|
"cost": 10000,
|
||||||
|
"dateEnd": 1687640400000,
|
||||||
|
"customer": "ООО \"Орлов\"",
|
||||||
|
"cityFrom": "Кемерово",
|
||||||
|
"cityTo": "Новокузнецк"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
const router = require('express').Router();
|
||||||
|
|
||||||
|
router.use('/performer', require('./dashboard-performer'))
|
||||||
|
|
||||||
|
module.exports = router;
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,9 +0,0 @@
|
|||||||
const { response } = require('express');
|
|
||||||
|
|
||||||
const router = require('express').Router();
|
|
||||||
|
|
||||||
router.get("/users", (request, response) => {
|
|
||||||
response.send(require("./json/users.json"))
|
|
||||||
})
|
|
||||||
|
|
||||||
module.exports = router;
|
|
||||||
Reference in new issue
Block a user