Compare commits
19 Commits
dogsitter-
...
4d621c8bbe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d621c8bbe | ||
|
|
ab8a9ebc99 | ||
|
|
872c921a53 | ||
| 10b5207f9a | |||
| 2ede62bcd8 | |||
| 1788f90cde | |||
| a37f7ea8a8 | |||
| 18b63bed21 | |||
| 707c3be3ec | |||
| 3d52ef9d4c | |||
| 42944af2d3 | |||
| f0f6b78cd0 | |||
|
|
7c35f17008 | ||
|
|
0208e29ae3 | ||
|
|
4d5cd104ad | ||
|
|
6702473053 | ||
| 52083097a2 | |||
| c95b015094 | |||
| 359a136dbf |
@@ -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
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
version: "3"
|
||||
|
||||
volumes:
|
||||
ms_volume:
|
||||
ms_volume8:
|
||||
|
||||
services:
|
||||
mongoDb:
|
||||
image: mongo:4.4.13
|
||||
image: mongo:8.0.3
|
||||
volumes:
|
||||
- ms_volume:/data/db
|
||||
- ms_volume8:/data/db
|
||||
restart: always
|
||||
# ports:
|
||||
# - 27017:27017
|
||||
|
||||
@@ -42,10 +42,15 @@ app.use(require('./root'))
|
||||
/**
|
||||
* Добавляйте сюда свои routers.
|
||||
*/
|
||||
app.use('/kfu-m-24-1', require('./routers/kfu-m-24-1'))
|
||||
app.use('/epja-2024-1', require('./routers/epja-2024-1'))
|
||||
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'))
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
const { response } = require('express');
|
||||
|
||||
const router = require('express').Router();
|
||||
|
||||
router.get("/users", (request, response) => {
|
||||
|
||||
37
server/routers/dry-wash/arm.js
Normal file
37
server/routers/dry-wash/arm.js
Normal file
@@ -0,0 +1,37 @@
|
||||
const router = require('express').Router()
|
||||
const {MasterModel} = require('./model/master')
|
||||
|
||||
router.post('/master', async (req, res,next) => {
|
||||
|
||||
const {name, phone} = req.body
|
||||
|
||||
if (!name || !phone ){
|
||||
throw new Error('Enter name and phone')
|
||||
}
|
||||
try {
|
||||
const master = await MasterModel.create({name, phone})
|
||||
res.status(200).send({success: true, body: master})
|
||||
} catch (error) {
|
||||
next(error)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
router.get('/masters', async (req, res,next) => {
|
||||
try {
|
||||
const master = await MasterModel.find({})
|
||||
res.status(200).send({success: true, body: master})
|
||||
} catch (error) {
|
||||
next(error)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
router.get('/orders', (req, res) => {
|
||||
res
|
||||
.status(200)
|
||||
.send(require(`./json/arm-orders/success.json`))
|
||||
})
|
||||
|
||||
module.exports = router
|
||||
8
server/routers/dry-wash/index.js
Normal file
8
server/routers/dry-wash/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const router = require('express').Router()
|
||||
const armRouter = require('./arm')
|
||||
|
||||
|
||||
router.use('/arm', armRouter)
|
||||
|
||||
|
||||
module.exports = router
|
||||
35
server/routers/dry-wash/json/arm-masters/success.json
Normal file
35
server/routers/dry-wash/json/arm-masters/success.json
Normal file
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
25
server/routers/dry-wash/json/arm-orders/success.json
Normal file
25
server/routers/dry-wash/json/arm-orders/success.json
Normal file
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
20
server/routers/dry-wash/model/master.js
Normal file
20
server/routers/dry-wash/model/master.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const { Schema, model } = require('mongoose')
|
||||
|
||||
const schema = new Schema({
|
||||
name: {type: String, required: true},
|
||||
phone: {type: String, required: true,unique: true,},
|
||||
created: {
|
||||
type: Date, default: () => new Date().toISOString(),
|
||||
},
|
||||
})
|
||||
|
||||
schema.set('toJSON', {
|
||||
virtuals: true,
|
||||
versionKey: false,
|
||||
})
|
||||
|
||||
schema.virtual('id').get(function () {
|
||||
return this._id.toHexString()
|
||||
})
|
||||
|
||||
exports.MasterModel = model('dry-wash-master', schema)
|
||||
30
server/routers/dry-wash/model/order.js
Normal file
30
server/routers/dry-wash/model/order.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const { Schema, model } = require('mongoose')
|
||||
|
||||
const schema = new Schema({
|
||||
startWashTime: {type: String, required: true},
|
||||
endWashTime: {type: String, required: true},
|
||||
orderDate: {type: String, required: true},
|
||||
location: {type: String, required: true},
|
||||
phone: {type: String, required: true},
|
||||
status: {type: String, required: true},
|
||||
carNumber: {type: String, required: true},
|
||||
created: {
|
||||
type: Date, default: () => new Date().toISOString(),
|
||||
},
|
||||
updated: {
|
||||
type: Date, default: () => new Date().toISOString(),
|
||||
},
|
||||
master: {type: Schema.Types.ObjectId, ref: 'dry-wash-master'},
|
||||
notes: String,
|
||||
})
|
||||
|
||||
schema.set('toJSON', {
|
||||
virtuals: true,
|
||||
versionKey: false,
|
||||
})
|
||||
|
||||
schema.virtual('id').get(function () {
|
||||
return this._id.toHexString()
|
||||
})
|
||||
|
||||
exports.OrderModel = model('dry-wash-order', schema)
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"info": {
|
||||
"_postman_id": "e91fbcf7-3c7b-420d-a49e-4dbb6199c14a",
|
||||
"name": "dry-wash",
|
||||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
||||
"_exporter_id": "27705820"
|
||||
},
|
||||
"item": [
|
||||
{
|
||||
"name": "arm",
|
||||
"item": [
|
||||
{
|
||||
"name": "create master",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"name\":\"Anton\",\n \"phone\": \"89172420577\"\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{host}}/arm/master",
|
||||
"host": [
|
||||
"{{host}}"
|
||||
],
|
||||
"path": [
|
||||
"arm",
|
||||
"master"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "get masters",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "{{host}}/arm/masters",
|
||||
"host": [
|
||||
"{{host}}"
|
||||
],
|
||||
"path": [
|
||||
"arm",
|
||||
"masters"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
15
server/routers/edateam-legacy/index.js
Normal file
15
server/routers/edateam-legacy/index.js
Normal file
@@ -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;
|
||||
112
server/routers/edateam-legacy/json/homepage-data/success.json
Normal file
112
server/routers/edateam-legacy/json/homepage-data/success.json
Normal file
@@ -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": [
|
||||
"Салаты"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
58
server/routers/edateam-legacy/json/recipe-data/success.json
Normal file
58
server/routers/edateam-legacy/json/recipe-data/success.json
Normal file
@@ -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,4 +7,6 @@ router.use('/cats', require('./cats/index'))
|
||||
|
||||
router.use('/ecliptica', require('./ecliptica/index'))
|
||||
|
||||
router.use('/sdk', require('./sdk/index'))
|
||||
|
||||
module.exports = router
|
||||
|
||||
123
server/routers/epja-2024-1/sdk/index.js
Normal file
123
server/routers/epja-2024-1/sdk/index.js
Normal file
@@ -0,0 +1,123 @@
|
||||
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;
|
||||
23
server/routers/freetracker/dashboard-performer/index.js
Normal file
23
server/routers/freetracker/dashboard-performer/index.js
Normal file
@@ -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": "Новокузнецк"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
5
server/routers/freetracker/index.js
Normal file
5
server/routers/freetracker/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
const router = require('express').Router();
|
||||
|
||||
router.use('/performer', require('./dashboard-performer'))
|
||||
|
||||
module.exports = router;
|
||||
@@ -0,0 +1,17 @@
|
||||
[
|
||||
{
|
||||
"id": 0,
|
||||
"description": "10 часто используемых",
|
||||
"imageFilename": "kart1.jpg"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"description": "10 слов в Data Science",
|
||||
"imageFilename": "kart1.jpg"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"description": "IT Basics Dictionary",
|
||||
"imageFilename": "kart1.jpg"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,275 @@
|
||||
[
|
||||
{
|
||||
"id": 0,
|
||||
"words": [
|
||||
{
|
||||
"id": 0,
|
||||
"word": "Tech",
|
||||
"definition": "short for technical, relating to the knowledge, machines, or methods used in science and industry. Tech is a whole industry, which includes IT",
|
||||
"examples": [
|
||||
"“As a DevOps engineer I have been working in Tech since 2020.”"
|
||||
],
|
||||
"synonyms": ["IT"]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"word": "career path",
|
||||
"definition": "the series of jobs or roles that constitute a person's career, especially one in a particular field",
|
||||
"examples": [
|
||||
"“Technology is an evolving field with a variety of available career paths.”"
|
||||
],
|
||||
"synonyms": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"words": [
|
||||
{
|
||||
"id": 0,
|
||||
"word": "Machine Learning",
|
||||
"translation": "Машинное обучение",
|
||||
"definition": "An approach to artificial intelligence where computers learn from data without being explicitly programmed.",
|
||||
"synonyms": ["Trainable Algorithms", "Automated Learning"],
|
||||
"examples": [
|
||||
"We used machine learning techniques to forecast product demand.",
|
||||
"The movie recommendation system is based on machine learning algorithms.",
|
||||
"Machine learning helped improve the accuracy of speech recognition in our application."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"word": "Neural Network",
|
||||
"translation": "Нейронная сеть",
|
||||
"definition": "A mathematical model inspired by the structure and function of biological neural networks, consisting of interconnected nodes organized in layers that can process information.",
|
||||
"synonyms": ["Artificial Neural Network", "Deep Neural Network"],
|
||||
"examples": [
|
||||
"To process large amounts of data, we created a deep learning neural network.",
|
||||
"This neural network is capable of generating realistic images.",
|
||||
"Using neural networks significantly improved the quality of text translation."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"word": "Algorithm",
|
||||
"translation": "Алгоритм",
|
||||
"definition": "A step-by-step procedure or set of instructions for solving a problem or performing a computation.",
|
||||
"synonyms": ["Procedure", "Method"],
|
||||
"examples": [
|
||||
"The algorithm we developed quickly finds the optimal delivery route.",
|
||||
"This algorithm sorts an array with a minimal number of operations.",
|
||||
"Encryption algorithms ensure secure transmission of data over the internet."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"word": "Data Model",
|
||||
"translation": "Модель данных",
|
||||
"definition": "An abstract representation of the structure of data, describing how data is organized and related to each other.",
|
||||
"synonyms": ["Data Structure", "Schema"],
|
||||
"examples": [
|
||||
"Our data model allows us to efficiently manage relationships between customers and orders.",
|
||||
"The data model was designed considering scalability and performance requirements.",
|
||||
"This data model is used for storing information about social network users."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"word": "Regression",
|
||||
"translation": "Регрессия",
|
||||
"definition": "A statistical method used to determine the relationship between one variable and others.",
|
||||
"synonyms": ["Linear Regression", "Nonlinear Regression"],
|
||||
"examples": [
|
||||
"We applied linear regression to analyze the impact of advertising campaigns on sales.",
|
||||
"Results from the regression analysis showed a strong correlation between customer age and purchase frequency.",
|
||||
"Regression helped us assess how changes in environmental conditions affect crop yield."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"word": "Clustering",
|
||||
"translation": "Кластеризация",
|
||||
"definition": "The process of grouping similar objects into clusters so that objects within the same cluster are more similar to each other than to those in other clusters.",
|
||||
"synonyms": ["Grouping", "Segmentation"],
|
||||
"examples": [
|
||||
"Clustering allowed us to divide customers into several groups according to their purchasing behavior.",
|
||||
"Clustering methods are used to automatically group news by topic.",
|
||||
"As a result of clustering, several market segments were identified, each with its own characteristics."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"word": "Supervised Learning",
|
||||
"translation": "Обучение с учителем",
|
||||
"definition": "A type of machine learning where the algorithm learns from labeled data, meaning data for which correct answers are known.",
|
||||
"synonyms": ["Controlled Learning", "Labeled Classification"],
|
||||
"examples": [
|
||||
"Supervised learning is used to classify emails as spam or not-spam.",
|
||||
"This approach was used to create a model that predicts real estate prices based on multiple parameters.",
|
||||
"Supervised learning helps diagnose diseases at early stages through medical data analysis."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"word": "Data Labeling",
|
||||
"translation": "Разметка данных",
|
||||
"definition": "The process of assigning labels or classes to data so it can be used in supervised learning.",
|
||||
"synonyms": ["Data Annotation", "Tagging"],
|
||||
"examples": [
|
||||
"Before starting model training, we labeled the data by assigning each photo an animal category.",
|
||||
"Data labeling includes marking user reviews as positive or negative.",
|
||||
"Text documents were labeled with special tags for subsequent analysis."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"word": "Hyperparameters",
|
||||
"translation": "Гиперпараметры",
|
||||
"definition": "Parameters that define the structure and behavior of a machine learning model, set before the learning process begins.",
|
||||
"synonyms": ["Model Settings", "Configuration Parameters"],
|
||||
"examples": [
|
||||
"Optimizing hyperparameters enabled us to enhance the performance of our machine learning model.",
|
||||
"Hyperparameters include settings such as the number of layers in a neural network and the learning rate.",
|
||||
"Choosing the right hyperparameters is crucial for achieving high model accuracy."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"word": "Model Validation",
|
||||
"translation": "Валидация модели",
|
||||
"definition": "The process of evaluating the quality of a model by testing it on new, previously unseen data.",
|
||||
"synonyms": ["Model Testing", "Model Verification"],
|
||||
"examples": [
|
||||
"After completing the training, we validated the model using a test dataset.",
|
||||
"During model validation, its ability to make accurate predictions on new data is checked.",
|
||||
"Validation showed that the model is robust against changes in data and has low generalization error."
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"words": [
|
||||
{
|
||||
"id": 0,
|
||||
"word": "software",
|
||||
"translation": "программное обеспечение",
|
||||
"definition": "A collection of computer instructions that perform a specific task, typically for use by humans or machines.",
|
||||
"synonyms": ["код", "приложение", "управление программами"],
|
||||
"examples":
|
||||
[
|
||||
"I need to update the software on my new laptop.",
|
||||
"The company uses Windows as its operating system."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"word": "hardware",
|
||||
"translation": "железо",
|
||||
"definition": "Physical components of a computer that process information, including processors and storage devices.",
|
||||
"synonyms": ["equipment", "приборы", "оборудование"],
|
||||
"examples":
|
||||
[
|
||||
"The keyboard is part of the hardware on this device.",
|
||||
"They upgraded their router to improve internet speed."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"word": "network",
|
||||
"translation": "сети",
|
||||
"definition": "A system of interconnected devices that communicate with each other through data transmission over a networked medium.",
|
||||
"synonyms": ["трансляция", "коммуникации", "диалог"],
|
||||
"examples":
|
||||
[
|
||||
"We use the internet to connect our devices in the same area.",
|
||||
"The company relies on their internal network for data sharing."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"word": "algorithm",
|
||||
"translation": "алгоритм",
|
||||
"definition": "A set of instructions that a computer follows to solve a problem or achieve a specific task.",
|
||||
"synonyms": ["процесс", "схема", "текст"],
|
||||
"examples":
|
||||
[
|
||||
"The algorithm for sorting numbers is easy to follow.",
|
||||
"The new software includes an advanced algorithm."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"word": "encryption",
|
||||
"translation": "криптография",
|
||||
"definition": "A technique that transforms information into a secure form, making it unreadable without the appropriate key.",
|
||||
"synonyms": ["шифрование", "окрышение", "опциональное"],
|
||||
"examples":
|
||||
[
|
||||
"Our data is encrypted to ensure its privacy and security.",
|
||||
"I need to use an encryption program for my important documents."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"word": "debugging",
|
||||
"translation": "поиск и исправление ошибок",
|
||||
"definition": "The process of identifying and correcting errors or defects in a computer program.",
|
||||
"synonyms": ["исправление", "сканирование", "анализ"],
|
||||
"examples":
|
||||
[
|
||||
"I need to debug the code for this new project.",
|
||||
"We use automated tools to find bugs."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"word": "API",
|
||||
"translation": "интерфейс приложения",
|
||||
"definition": "A set of rules and protocols that enables communication between software applications, typically over a network.",
|
||||
"synonyms": ["серверное программирование", "функциональная структура"],
|
||||
"examples":
|
||||
[
|
||||
"We use the API for our mobile app to access data from the backend server.",
|
||||
"I need to write an API for connecting my devices to the internet."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"word": "virtual",
|
||||
"translation": "виртуальный",
|
||||
"definition": "A representation of a thing that does not exist physically but exists in digital form.",
|
||||
"synonyms": ["высокопроизводительный", "представление", "цифровой"],
|
||||
"examples":
|
||||
[
|
||||
"I use virtual reality to experience different environments.",
|
||||
"Our company offers virtual office spaces for remote work."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"word": "infrastructure",
|
||||
"translation": "инфраструктура",
|
||||
"definition": "The underlying systems and equipment of a computer network or organization, including hardware, software, and physical connections.",
|
||||
"synonyms": ["оборудование", "устройство", "системы"],
|
||||
"examples":
|
||||
[
|
||||
"Our IT infrastructure is robust to ensure reliable operations.",
|
||||
"They need to improve their internet infrastructure for better connectivity."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"word": "hacker",
|
||||
"translation": "хакер",
|
||||
"definition": "A skilled individual who uses computer technology to break into and misuse a system or network.",
|
||||
"synonyms": ["дезориентированный", "манипулятор", "прокурор"],
|
||||
"examples":
|
||||
[
|
||||
"I need to avoid getting involved with hackers.",
|
||||
"They were caught hacking into the company's confidential database."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
76
server/routers/kfu-m-24-1/eng-it-lean/dictionaries/index.js
Normal file
76
server/routers/kfu-m-24-1/eng-it-lean/dictionaries/index.js
Normal file
@@ -0,0 +1,76 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const router = require("express").Router();
|
||||
|
||||
module.exports = router;
|
||||
|
||||
const data = require("./data/dictionaries.json");
|
||||
const wordsData = require("./data/dictionaryWords.json");
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
res.send(data);
|
||||
});
|
||||
|
||||
// Put new dictionary to the array of dictionaries
|
||||
router.put('/new', (req, res) => {
|
||||
if (!data || !Array.isArray(data)) {
|
||||
return res.status(400).send('No array of dictionaries found`');
|
||||
}
|
||||
|
||||
const updatedData = req.body;
|
||||
|
||||
if (!updatedData) {
|
||||
return res.status(400).send('No data to update'); // Bad request
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return res.status(500).send('No data to update'); // Internal server error
|
||||
}
|
||||
|
||||
indexedUpdatedData = { id: data.length, ...updatedData }; // Add the new dictionary to the array
|
||||
|
||||
data.push(indexedUpdatedData); // Add the new dictionary to the array
|
||||
|
||||
fs.writeFile(path.join(__dirname, 'data/dictionaries.json'), JSON.stringify(data), (err) => {
|
||||
if (err) {
|
||||
console.error(err); // Log the error
|
||||
return res.status(500).send('Error saving data');
|
||||
}
|
||||
res.status(200).json(data); // Send back the updated data
|
||||
});
|
||||
});
|
||||
|
||||
router.delete('/:id', (req, res) => {
|
||||
const id = parseInt(req.params.id); // Get the dictionary id from the URL
|
||||
|
||||
if (!id || isNaN(id)) {
|
||||
return res.status(400).send('Invalid ID'); // Bad request
|
||||
}
|
||||
|
||||
const index = data.findIndex((dictionary) => dictionary.id === id);
|
||||
|
||||
if (index < 0) {
|
||||
return res.status(404).send('Not found'); // Not found
|
||||
}
|
||||
|
||||
data.splice(index, 1); // Remove the dictionary from the array
|
||||
|
||||
fs.writeFile(path.join(__dirname, 'data/dictionaries.json'), JSON.stringify(data), (err) => {
|
||||
if (err) {
|
||||
console.error(err); // Log the error
|
||||
return res.status(500).send('Error saving data');
|
||||
}
|
||||
res.send({ message: `Dictionary with id ${id} deleted` });
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/:id", (req, res) => {
|
||||
const id = parseInt(req.params.id);
|
||||
const words = wordsData.find((word) => word.id === id);
|
||||
|
||||
if (!words) {
|
||||
return res.status(404).send("Not found");
|
||||
}
|
||||
|
||||
res.send(words);
|
||||
});
|
||||
15
server/routers/kfu-m-24-1/eng-it-lean/index.js
Normal file
15
server/routers/kfu-m-24-1/eng-it-lean/index.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const router = require("express").Router();
|
||||
|
||||
const dictionariesRouter = require("./dictionaries");
|
||||
const unitsRouter = require('./units');
|
||||
module.exports = router;
|
||||
|
||||
const delay =
|
||||
(ms = 250) =>
|
||||
(req, res, next) => {
|
||||
setTimeout(next, ms);
|
||||
};
|
||||
|
||||
router.use(delay());
|
||||
router.use("/dictionaries", dictionariesRouter);
|
||||
router.use('/units', unitsRouter);
|
||||
71
server/routers/kfu-m-24-1/eng-it-lean/units/data/unit-1.md
Normal file
71
server/routers/kfu-m-24-1/eng-it-lean/units/data/unit-1.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# Unit 1. Multifunctional Verbs: Be, Have, and Do
|
||||
|
||||
## Overview
|
||||
|
||||
This unit focuses on the use of multifunctional verbs in English. These verbs are able to express multiple meanings depending on their use in a sentence.
|
||||
|
||||
## Learning Objectives
|
||||
|
||||
By the end of this unit, you will be able to:
|
||||
|
||||
- Identify the different forms of the main multifunctional verb.
|
||||
- Explain how these forms can be used interchangeably in sentences.
|
||||
- Demonstrate the correct usage of the three forms of the multifunctional verb by providing sentences and examples.
|
||||
|
||||
## Vocabulary Review
|
||||
|
||||
| Term | Definition |
|
||||
| ---- | -------------------------------------------------------- |
|
||||
| Be | To express a present or ongoing state of being. |
|
||||
| Have | To express ownership or possession. |
|
||||
| Do | To express an action to be done, future action or habit. |
|
||||
|
||||
## Activities
|
||||
|
||||
### Activity 1: Identify the Different Forms of the Main Multifunctional Verb
|
||||
|
||||
- Read through each sentence and identify if the verb is used in its present tense (is), past tense (was/were), or future tense (will, would).
|
||||
- Discuss how this usage can vary depending on context.
|
||||
- Write down sentences that use different forms to illustrate your points.
|
||||
|
||||
1. **Sentence 1**: "The cat is sleeping."
|
||||
|
||||
- Present tense: The cat is sleeping.
|
||||
- Past tense: The cat slept.
|
||||
- Future tense: The cat will sleep.
|
||||
|
||||
2. **Sentence 2**: "I have a dog at home."
|
||||
|
||||
- Present tense: I have a dog.
|
||||
- Past tense: I had a dog.
|
||||
- Future tense: I will have a dog.
|
||||
|
||||
3. **Sentence 3**: "We are going on a hike tomorrow."
|
||||
|
||||
- Present tense: We are going on a hike.
|
||||
- Past tense: We went on a hike.
|
||||
- Future tense: We will go on a hike.
|
||||
|
||||
4. **Sentence 4**: "He has been studying all day."
|
||||
|
||||
- Present tense: He is studying.
|
||||
- Past tense: He studied.
|
||||
- Future tense: He will study.
|
||||
|
||||
5. **Sentence 5**: "We are going to buy some groceries later today."
|
||||
- Present tense: We are going to buy some groceries.
|
||||
- Past tense: We bought some groceries.
|
||||
- Future tense: We will buy some groceries.
|
||||
|
||||
### Activity 2: Explain How These Forms Can Be Used Interchangeably in Sentences
|
||||
|
||||
- Read through a sentence and identify the present, past, and future tense uses.
|
||||
- In pairs, explain why these forms are used interchangeably.
|
||||
- Provide examples of sentences that demonstrate this usage.
|
||||
- Highlight how the context changes the meaning.
|
||||
|
||||
### Activity 3: Correct Usage of the Three Forms of the Multifunctional Verb
|
||||
|
||||
- Read through a sentence and identify which form is being used.
|
||||
- In pairs, discuss why these forms are used in certain situations.
|
||||
- Provide sentences that demonstrate the correct usage of the three forms.
|
||||
@@ -0,0 +1 @@
|
||||
[{"id":0,"filename":"unit-1","name":"Unit 1: Multifunctional Verbs: Be, Have, and Do"}]
|
||||
58
server/routers/kfu-m-24-1/eng-it-lean/units/index.js
Normal file
58
server/routers/kfu-m-24-1/eng-it-lean/units/index.js
Normal file
@@ -0,0 +1,58 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const router = require('express').Router();
|
||||
|
||||
module.exports = router;
|
||||
|
||||
const data = require('./data/units.json');
|
||||
router.get('/', (req, res) => {
|
||||
res.send(data);
|
||||
});
|
||||
|
||||
router.put('/', (req, res) => {
|
||||
const newUnit = req.body
|
||||
|
||||
if (!newUnit) {
|
||||
return res.status(400).send('No new unit to be added')
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return res.status(500).send('No data to be updated')
|
||||
}
|
||||
|
||||
data.push({ "id": data.length, ...newUnit })
|
||||
|
||||
fs.writeFileSync(path.join(__dirname, 'data', 'units.json'), JSON.stringify(data));
|
||||
res.status(200).send(data);
|
||||
});
|
||||
|
||||
router.delete('/:id', (req, res) => {
|
||||
const id = parseInt(req.params.id);
|
||||
const index = data.findIndex((unit) => unit.id === id);
|
||||
|
||||
if (index < 0) {
|
||||
return res.status(404).send('Not found');
|
||||
}
|
||||
|
||||
data.splice(index, 1);
|
||||
fs.writeFileSync(path.join(__dirname, 'data', 'units.json'), JSON.stringify(data));
|
||||
res.send({ message: `Unit with ID ${id} deleted` });
|
||||
});
|
||||
|
||||
router.get('/:id', (req, res) => {
|
||||
const id = parseInt(req.params.id);
|
||||
const unit = data.find((unit) => unit.id === id);
|
||||
|
||||
if (!unit) {
|
||||
return res.status(404).send('Not found');
|
||||
}
|
||||
|
||||
const unitFilepath = path.join(__dirname, 'data', `${unit.filename}.md`);
|
||||
const unitContent = fs.readFileSync(unitFilepath, 'utf-8');
|
||||
|
||||
if (!unitContent) {
|
||||
return res.status(404).send('Not found');
|
||||
}
|
||||
|
||||
res.send({ ...unit, content: unitContent });
|
||||
});
|
||||
7
server/routers/kfu-m-24-1/index.js
Normal file
7
server/routers/kfu-m-24-1/index.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const { Router } = require('express')
|
||||
const router = Router()
|
||||
|
||||
router.use('/eng-it-lean', require('./eng-it-lean/index'))
|
||||
|
||||
module.exports = router
|
||||
|
||||
Reference in New Issue
Block a user