From f0f6b78cd0f31cac9021ee11f309a1d17c7ad6b4 Mon Sep 17 00:00:00 2001 From: ilnaz <237x237@gmail.com> Date: Sun, 8 Dec 2024 11:50:39 +0300 Subject: [PATCH] feat: add dry wash json --- d-scripts/rerun.sh | 2 +- server/index.js | 1 + server/routers/dry-wash/index.js | 15 ++++++++ .../dry-wash/json/arm-masters/success.json | 35 +++++++++++++++++++ .../dry-wash/json/arm-orders/success.json | 25 +++++++++++++ 5 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 server/routers/dry-wash/index.js create mode 100644 server/routers/dry-wash/json/arm-masters/success.json create mode 100644 server/routers/dry-wash/json/arm-orders/success.json diff --git a/d-scripts/rerun.sh b/d-scripts/rerun.sh index b001f65..03dbb37 100644 --- a/d-scripts/rerun.sh +++ b/d-scripts/rerun.sh @@ -3,4 +3,4 @@ docker stop ms-mongo docker volume remove 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 diff --git a/server/index.js b/server/index.js index 2609af1..aaa41f8 100644 --- a/server/index.js +++ b/server/index.js @@ -47,6 +47,7 @@ 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(require('./error')) diff --git a/server/routers/dry-wash/index.js b/server/routers/dry-wash/index.js new file mode 100644 index 0000000..4f4b95f --- /dev/null +++ b/server/routers/dry-wash/index.js @@ -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 diff --git a/server/routers/dry-wash/json/arm-masters/success.json b/server/routers/dry-wash/json/arm-masters/success.json new file mode 100644 index 0000000..ce50415 --- /dev/null +++ b/server/routers/dry-wash/json/arm-masters/success.json @@ -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" + } + ] +} diff --git a/server/routers/dry-wash/json/arm-orders/success.json b/server/routers/dry-wash/json/arm-orders/success.json new file mode 100644 index 0000000..15669e8 --- /dev/null +++ b/server/routers/dry-wash/json/arm-orders/success.json @@ -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" + } + ] +} \ No newline at end of file