Compare commits

...

37 Commits

Author SHA1 Message Date
Primakov Alexandr Alexandrovich
8a2afc3f1b 1.1.1 2025-01-19 21:05:16 +03:00
Primakov Alexandr Alexandrovich
d824844ae5 populate author of comments 2025-01-19 21:05:08 +03:00
Primakov Alexandr Alexandrovich
f95a26acbb todo-app: get item by id 2025-01-19 20:44:26 +03:00
e0618e431f feat: add get date orders 2025-01-19 11:29:11 +03:00
1b93a8e2bb fix: change get for orders v2 2025-01-19 10:23:48 +03:00
b8dc15cbc6 Merge pull request 'feat: use stubs for orders data (#64)' (#62) from feature/dry-wash-orders into master
Reviewed-on: #62
Reviewed-by: Primakov Alexandr Alexandrovich <primakovpro@gmail.com>
2025-01-19 10:11:41 +03:00
RustamRu
949416d2a3 feat: use stubs for orders data (#64) 2025-01-18 23:02:45 +03:00
RustamRu
1ec9f1a7ec Revert "feat: use stubs for orders data (#64)"
This reverts commit 87c1cbb19e.
2025-01-18 23:00:20 +03:00
RustamRu
17c63e6fe0 Merge branch 'master' of ssh://85.143.175.152:222/bro-students/multy-stub 2025-01-18 22:58:00 +03:00
RustamRu
87c1cbb19e feat: use stubs for orders data (#64) 2025-01-18 22:57:56 +03:00
c86f84d037 merge: feature(freetracker): landing requests 2025-01-18 20:36:14 +03:00
b8bc2c83a3 Merge branch 'feature/freetracker-landing' 2025-01-18 20:32:00 +03:00
552457b5cb feature(freetracker): landing requests
All checks were successful
platform/multy-stub/pipeline/head This commit looks good
2025-01-18 20:28:22 +03:00
aaeii
909f7e4de9 update gamehub gamepage, categories 2025-01-18 19:48:02 +03:00
Primakov Alexandr Alexandrovich
86b79a7f49 comments 2025-01-18 17:45:16 +03:00
Primakov Alexandr Alexandrovich
d2d8b63aba fix item create 2025-01-18 17:16:35 +03:00
Primakov Alexandr Alexandrovich
0dcf961cce todo CR todo list 2025-01-18 17:08:09 +03:00
Primakov Alexandr Alexandrovich
38bc0c55c8 1.1.0 2025-01-18 16:52:14 +03:00
Primakov Alexandr Alexandrovich
9fb4219418 todo list get list 2025-01-18 16:52:10 +03:00
Primakov Alexandr Alexandrovich
fb644b6f7b create todo list 2025-01-18 16:50:58 +03:00
Primakov Alexandr Alexandrovich
d88e680413 todo auth 2025-01-18 15:44:14 +03:00
Primakov Alexandr Alexandrovich
8b7f43d15a mode todo in todo folder 2025-01-17 19:51:33 +03:00
b9edd0091c Merge pull request 'delete masters _id' (#60) from feature/arm-master-id into master
Reviewed-on: #60
2025-01-13 17:26:46 +03:00
RustamRu
558245f876 delete masters _id
Some checks failed
platform/multy-stub/pipeline/head There was a failure building this commit
2025-01-12 11:12:24 +03:00
a927727c1b Merge pull request 'fix: change get for orders' (#59) from fix/orders-get into master
Reviewed-on: #59
2025-01-12 10:43:08 +03:00
a9d9aa02da fix: change get for orders
Some checks failed
platform/multy-stub/pipeline/head There was a failure building this commit
2025-01-12 10:40:50 +03:00
e7451aea5b Merge pull request 'added stubs for kazan-explore sport quiz' (#58) from kazan-explore into master
Reviewed-on: #58
2025-01-11 20:27:32 +03:00
3fe62ec268 Merge pull request 'add auth in freetracker' (#57) from freetracker-add-auth into master
Reviewed-on: #57
2024-12-31 10:12:39 +03:00
e73f7e2dc9 add auth in freetracker
Some checks failed
platform/multy-stub/pipeline/head There was a failure building this commit
2024-12-31 10:11:17 +03:00
571c43c33c add sberhubproject 2024-12-28 11:02:11 +03:00
61c847b58c Merge pull request 'kfu-m-24-1/eng-it-lean' (#56) from kfu-m-24-1/eng-it-lean into master
Reviewed-on: #56
2024-12-28 10:24:59 +03:00
Ruslan Zagitov
4d621c8bbe chore: add new dictionary 2024-12-27 23:32:54 +03:00
Ruslan Zagitov
ab8a9ebc99 feat: add '/units' endpoints; add 'put' and 'delete' requests to '/dictionaries' endpoint 2024-12-27 23:15:26 +03:00
2d1a4ba8db Merge pull request 'fixing stub paths' (#55) from kazan-explore into master
Reviewed-on: #55
2024-12-27 23:01:16 +03:00
8bd3ccfce7 Merge pull request 'kazan-explore stubs changed, added translation' (#54) from kazan-explore into master
Reviewed-on: #54
2024-12-27 22:41:23 +03:00
aaeii
fe8a477b27 Merge branch 'master' of https://git.bro-js.ru/bro-students/multy-stub 2024-12-27 21:30:20 +03:00
aaeii
12af9b7c10 добавили окно с просмотром игр 2024-12-27 21:29:26 +03:00
1001 changed files with 1757 additions and 155 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "multi-stub",
"version": "1.0.1",
"version": "1.1.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "multi-stub",
"version": "1.0.1",
"version": "1.1.1",
"license": "MIT",
"dependencies": {
"axios": "^1.7.9",

View File

@@ -1,6 +1,6 @@
{
"name": "multi-stub",
"version": "1.0.1",
"version": "1.1.1",
"description": "",
"main": "index.js",
"scripts": {

View File

@@ -1,2 +0,0 @@
exports.TODO_LIST_MODEL_NAME = 'TODO_LIST'
exports.TODO_ITEM_MODEL_NAME = 'TODO_ITEM'

View File

@@ -1,23 +0,0 @@
const { Schema, model } = require('mongoose')
const { TODO_ITEM_MODEL_NAME } = require('../../const')
const schema = new Schema({
title: String,
done: { type: Boolean, default: false },
closed: Date,
created: {
type: Date, default: () => new Date().toISOString(),
},
})
schema.set('toJSON', {
virtuals: true,
versionKey: false,
})
schema.virtual('id').get(function () {
return this._id.toHexString()
})
exports.ItemModel = model(TODO_ITEM_MODEL_NAME, schema)

View File

@@ -80,7 +80,7 @@ app.use(require("./root"))
*/
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("/v1/todo", require("./routers/todo"))
app.use("/dogsitters-finder", require("./routers/dogsitters-finder"))
app.use("/kazan-explore", require("./routers/kazan-explore"))
app.use("/edateam", require("./routers/edateam-legacy"))

View File

@@ -1,9 +1,21 @@
const router = require('express').Router()
const { OrderModel } = require('./model/order')
router.get('/orders', (req, res) => {
res
.status(200)
.send(require(`./json/arm-orders/success.json`))
router.post('/orders', async (req, res, next) => {
const {startDate, endDate} = req.body
if (!startDate || !endDate) {
throw new Error('startDate and endDate are required')
}
const orders = await OrderModel.find({
$or: [
{startWashTime: { $gte: new Date(startDate), $lte: new Date(endDate) }},
{endWashTime: { $gte: new Date(startDate), $lte: new Date(endDate) }},
]
})
res.status(200).send({ success: true, body: orders })
})
module.exports = router

View File

@@ -1,10 +1,12 @@
const router = require('express').Router()
const armMasterRouter = require('./arm-master')
const armOrdersRouter = require('./arm-orders')
const orderRouter = require('./order')
router.use('/arm', armMasterRouter)
router.use('/arm', armOrdersRouter)
router.use('/order', orderRouter)
module.exports = router

View File

@@ -2,24 +2,59 @@
"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",
"phone": "+79876543210",
"carNumber": "А123ВЕ16",
"carBody": 1,
"carColor": "#ffff00",
"startWashTime": "2025-05-12T08:21:00.000Z",
"endWashTime": "2025-05-12T08:22:00.000Z",
"location": "55.792799704829854,49.11034340707925 Республика Татарстан (Татарстан), Казань, улица Чернышевского",
"status": "progress",
"phone": "79001234563",
"location": "Казань, ул. Баумана, 1"
"notes": "",
"created": "2025-01-18T17:43:21.488Z",
"updated": "2025-01-18T17:43:21.492Z"
},
{
"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",
"phone": "89876543210",
"carNumber": "К456МН23",
"carBody": 2,
"carColor": "#ffffff",
"startWashTime": "2025-01-12T08:21:00Z",
"endWashTime": "2025-01-12T08:22:00Z",
"location": "55.808430668108585,49.198608125449255 Республика Татарстан (Татарстан), Казань, улица Академика Губкина, 50/1",
"status": "pending",
"notes": "заметки заметки заметки заметки заметки заметки заметки заметки заметки заметки заметки заметки заметки заметки заметки",
"created": "2025-01-18T17:46:10.388Z",
"updated": "2025-01-18T17:46:10.395Z",
"id": "678be8e211e62f4a61790cca"
},
{
"phone": "4098765432105",
"carNumber": "О789РС777",
"carBody": 3,
"carColor": "красный",
"startWashTime": "2025-08-12T08:21:00.000Z",
"endWashTime": "2025-08-12T08:22:00.000Z",
"location": "55.78720449830353,49.12111640202319 Республика Татарстан (Татарстан), Казань, улица Пушкина, 5/43",
"status": "cancelled",
"notes": "Заказ отменен по запросу самого клиента",
"created": "2025-01-18T17:47:46.294Z",
"updated": "2025-01-18T17:47:46.295Z",
"id": "678be8e211e62f4a61790ccb"
},
{
"phone": "+79876543210",
"carNumber": "Т123УХ716",
"carBody": 99,
"carColor": "чайная роза",
"startWashTime": "2025-01-11T11:21:00.000Z",
"endWashTime": "2025-01-12T11:22:00.000Z",
"location": "55.77063673480112,49.22182909159608 Республика Татарстан (Татарстан), Казань, Советский район, микрорайон Азино-2",
"status": "progress",
"phone": "79001234567",
"location": "Казань, ул. Баумана, 43"
"notes": "Клиент остался доволен, предложить в следующий раз акцию",
"created": "2025-01-18T17:55:05.691Z",
"updated": "2025-01-18T17:55:05.695Z",
"id": "678be8e211e62f4a61790ccc"
}
]
}

View File

@@ -0,0 +1,11 @@
const orderStatus = {
CANCELLED: 'cancelled',
PROGRESS: 'progress',
PENDING: 'pending',
WORKING: 'working',
COMPLETE: 'complete',
}
module.exports = {
orderStatus
}

View File

@@ -11,6 +11,9 @@ const schema = new Schema({
schema.set('toJSON', {
virtuals: true,
versionKey: false,
transform(_doc, ret) {
delete ret._id;
}
})
schema.virtual('id').get(function () {

View File

@@ -1,26 +1,58 @@
const { Schema, model } = require('mongoose')
const { orderStatus } = require('./const')
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},
phone: {
type: String,
required: true
},
carNumber: {
type: String,
required: true
},
carBody: {
type: Number,
required: true
},
carColor: String,
startWashTime: {
type: Date,
required: true
},
endWashTime: {
type: Date,
required: true
},
location: {
type: String,
required: true
},
status: {
type: String,
required: true,
enum: Object.values(orderStatus)
},
master: {
type: Schema.Types.ObjectId,
ref: 'dry-wash-master'
},
notes: String,
created: {
type: Date, default: () => new Date().toISOString(),
type: Date,
default: () => new Date().toISOString(),
},
updated: {
type: Date, default: () => new Date().toISOString(),
type: Date,
default: () => new Date().toISOString(),
},
master: {type: Schema.Types.ObjectId, ref: 'dry-wash-master'},
notes: String,
})
schema.set('toJSON', {
virtuals: true,
versionKey: false,
transform(_doc, ret) {
delete ret._id
}
})
schema.virtual('id').get(function () {

View File

@@ -0,0 +1,251 @@
const mongoose = require("mongoose")
const router = require('express').Router()
const { MasterModel } = require('./model/master')
const { OrderModel } = require('./model/order')
const { orderStatus } = require('./model/const')
const isValidPhoneNumber = (value) => /^(\+)?\d{9,15}/.test(value)
const isValidCarNumber = (value) => /^[авекмнорстух][0-9]{3}[авекмнорстух]{2}[0-9]{2,3}$/i.test(value)
const isValidCarBodyType = (value) => typeof value === 'number' && value > 0 && value < 100
const isValidCarColor = (value) => value.length < 50 && /^[#a-z0-9а-я-\s,.()]+$/i.test(value)
const isValidISODate = (value) => /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:.\d{1,3})?Z$/.test(value)
const latitudeRe = /^(-?[1-8]?\d(?:\.\d{1,18})?|90(?:\.0{1,18})?)$/
const longitudeRe = /^(-?(?:1[0-7]|[1-9])?\d(?:\.\d{1,18})?|180(?:\.0{1,18})?)$/
const addressRe = /^[а-я0-9\s,.'-/()]*$/i
const isValidLocation = (value) => {
if (value.length > 200) {
return false
}
const [coordinates, address] = value.split(' ')
const [latitude, longitude] = coordinates.split(',')
return latitudeRe.test(latitude) && longitudeRe.test(longitude) && addressRe.test(address)
}
const isValidOrderStatus = (value) => Object.values(orderStatus).includes(value)
const isValidOrderNotes = (value) => value.length < 500
const VALIDATION_MESSAGES = {
order: {
notFound: 'Order not found'
},
orderId: {
invalid: 'Valid order ID is required',
},
orderStatus: {
invalid: 'Invalid order status'
},
orderNotes: {
invalid: 'Invalid order notes'
},
master: {
notFound: 'Master not found'
},
masterId: {
invalid: 'Invalid master ID',
},
phoneNumber: {
required: 'Phone number is required',
invalid: 'Invalid phone number'
},
carNumber: {
required: 'Car number is required',
invalid: 'Invalid car number'
},
carBody: {
required: 'Car body type is required',
invalid: 'Invalid car body type'
},
carColor: {
invalid: 'Invalid car color'
},
washingBegin: {
required: 'Begin time of washing is required',
invalid: 'Invalid begin time of washing'
},
washingEnd: {
required: 'End time of washing is required',
invalid: 'Invalid end time of washing'
},
washingLocation: {
required: 'Location of washing is required',
invalid: 'Invalid location of washing'
},
}
router.post('/create', async (req, res, next) => {
const bodyErrors = []
const { customer } = req.body
if (!customer.phone) {
bodyErrors.push(VALIDATION_MESSAGES.phoneNumber.required)
} else if (!isValidPhoneNumber(customer.phone)) {
bodyErrors.push(VALIDATION_MESSAGES.phoneNumber.invalid)
}
const { car } = req.body
if (!car.number) {
bodyErrors.push(VALIDATION_MESSAGES.carNumber.required)
} else if (!isValidCarNumber(car.number)) {
bodyErrors.push(VALIDATION_MESSAGES.carNumber.invalid)
}
if (!car.body) {
bodyErrors.push(VALIDATION_MESSAGES.carBody.required)
} else if (!isValidCarBodyType(car.body)) {
bodyErrors.push(VALIDATION_MESSAGES.carBody.invalid)
}
if (!isValidCarColor(car.color)) {
bodyErrors.push(VALIDATION_MESSAGES.carColor.invalid)
}
const { washing } = req.body
if (!washing.begin) {
bodyErrors.push(VALIDATION_MESSAGES.washingBegin.required)
} else if (!isValidISODate(washing.begin)) {
bodyErrors.push(VALIDATION_MESSAGES.washingBegin.invalid)
}
if (!washing.end) {
bodyErrors.push(VALIDATION_MESSAGES.washingEnd.required)
} else if (!isValidISODate(washing.end)) {
bodyErrors.push(VALIDATION_MESSAGES.washingEnd.invalid)
}
if (!washing.location) {
bodyErrors.push(VALIDATION_MESSAGES.washingLocation.required)
} else if (!isValidLocation(washing.location)) {
bodyErrors.push(VALIDATION_MESSAGES.washingLocation.invalid)
}
if (bodyErrors.length > 0) {
throw new Error(bodyErrors.join(', '))
}
try {
const order = await OrderModel.create({
phone: customer.phone,
carNumber: car.number,
carBody: car.body,
carColor: car.color,
startWashTime: washing.begin,
endWashTime: washing.end,
location: washing.location,
status: orderStatus.PROGRESS,
notes: '',
created: new Date().toISOString(),
})
res.status(200).send({ success: true, body: order })
} catch (error) {
next(error)
}
})
router.get('/:id', async (req, res, next) => {
const { id } = req.params
if (!mongoose.Types.ObjectId.isValid(id)) {
throw new Error(VALIDATION_MESSAGES.orderId.invalid)
}
try {
const order = await OrderModel.findById(id)
if (!order) {
throw new Error(VALIDATION_MESSAGES.order.notFound)
}
res.status(200).send({ success: true, body: order })
} catch (error) {
next(error)
}
})
router.patch('/:id', async (req, res, next) => {
const { id } = req.params
if (!mongoose.Types.ObjectId.isValid(id)) {
throw new Error(VALIDATION_MESSAGES.orderId.invalid)
}
const bodyErrors = []
const { status } = req.body
if (status) {
if (!isValidOrderStatus(status)) {
bodyErrors.push(VALIDATION_MESSAGES.orderStatus.invalid)
}
}
const { master: masterId } = req.body
if (masterId) {
if (!mongoose.Types.ObjectId.isValid(masterId)) {
bodyErrors.push(VALIDATION_MESSAGES.masterId.invalid)
} else {
try {
const master = await MasterModel.findById(masterId)
if (!master) {
bodyErrors.push(VALIDATION_MESSAGES.master.notFound)
}
} catch (error) {
next(error)
}
}
}
const { notes } = req.body
if (notes) {
if (!isValidOrderNotes(notes)) {
bodyErrors.push(VALIDATION_MESSAGES.orderNotes.invalid)
}
}
if (bodyErrors.length > 0) {
throw new Error(bodyErrors.join(', '))
}
try {
const updateData = {}
if (status) {
updateData.status = status
}
if (masterId) {
updateData.master = masterId
}
if (notes) {
updateData.notes = notes
}
updateData.updated = new Date().toISOString()
const order = await OrderModel.findByIdAndUpdate(
id,
updateData,
{ new: true }
)
if (!order) {
throw new Error(VALIDATION_MESSAGES.order.notFound)
}
res.status(200).send({ success: true, body: order })
} catch (error) {
next(error)
}
})
router.delete('/:id', async (req, res, next) => {
const { id } = req.params
if (!mongoose.Types.ObjectId.isValid(id)) {
throw new Error(VALIDATION_MESSAGES.orderId.invalid)
}
try {
const order = await OrderModel.findByIdAndDelete(id, {
new: true,
})
if (!order) {
throw new Error(VALIDATION_MESSAGES.order.notFound)
}
res.status(200).send({ success: true, body: order })
} catch (error) {
next(error)
}
})
module.exports = router

View File

@@ -0,0 +1,24 @@
const Router = require('express').Router
const router = Router()
router.post('/auth/login', (req, res) => {
if (req.body.email === 'qwerty@mail.ru') {
res.status(200).send(require('./json/login/login-success.json'))
} else {
res.status(401).send(require('./json/login/login-error.json'));
}
})
router.post('/auth/register', (req, res) => {
res.status(400).send(require('./json/registration/registration-error.json'))
// res.status(201).send(require('./json/registration/registration-error.json'))
})
router.post('/auth/reset-password', (req, res) => {
res.status(200).send(require('./json/reset-password/reset-password-success.json'))
// res.status(404).send(require('./json/reset-password/reset-password-error.json'))
})
module.exports = router;

View File

@@ -0,0 +1,11 @@
{
"success": false,
"body": null,
"errors": [
{
"code": "AUTH_INVALID_CREDENTIALS",
"message": "Неверное имя пользователя или пароль"
}
],
"warnings": []
}

View File

@@ -0,0 +1,8 @@
{
"success": true,
"body": {
"token": "AUTH_TOKEN"
},
"errors": [],
"warnings": []
}

View File

@@ -0,0 +1,11 @@
{
"success": false,
"body": null,
"errors": [
{
"code": "REGISTRATION_EMAIL_TAKEN",
"message": "Электронная почта уже используется"
}
],
"warnings": []
}

View File

@@ -0,0 +1,9 @@
{
"success": true,
"body": {
"userId": "12345",
"token": "AUTH_TOKEN"
},
"errors": [],
"warnings": []
}

View File

@@ -0,0 +1,11 @@
{
"success": false,
"body": null,
"errors": [
{
"code": "RESET_PASSWORD_EMAIL_NOT_FOUND",
"message": "Адрес электронной почты не зарегистрирован"
}
],
"warnings": []
}

View File

@@ -0,0 +1,8 @@
{
"success": true,
"body": {
"message": "Отправлено электронное письмо для сброса пароля"
},
"errors": [],
"warnings": []
}

View File

@@ -1,5 +1,7 @@
const router = require('express').Router();
router.use('/performer', require('./dashboard-performer'))
router.use('/auth', require('./auth'))
router.use('/landing', require('./landing'))
module.exports = router;

View File

@@ -0,0 +1,29 @@
const Router = require('express').Router;
const router = Router()
const values = {
'blocks': 'success',
'application': 'success'
}
const timer = (_req, _res, next) => {
setTimeout(() => next(), 500)
}
router.use(timer)
router.get(
'/blocks',
(req, res) =>
res.send(require(`./json/blocks-${values['blocks']}.json`))
)
router.post(
'/application',
(req, res) => {
res.send(require(`./json/application-${values['application']}.json`))
}
)
module.exports = router

View File

@@ -0,0 +1,7 @@
{
"success": false,
"body": { },
"errors": [
"Что-то пошло не так"
]
}

View File

@@ -0,0 +1,4 @@
{
"success": true,
"body": { }
}

View File

@@ -0,0 +1,9 @@
{
"success": false,
"body": {
"blocks": []
},
"errors": [
"Что-то пошло не так"
]
}

View File

@@ -0,0 +1,22 @@
{
"success": true,
"body": {
"blocks": [
{
"titleKey":"block1.title",
"textKey":"block1.subtitle",
"imageName":"truck1"
},
{
"titleKey":"block2.title",
"textKey":"block2.subtitle",
"imageName":"truck2"
},
{
"titleKey":"block3.title",
"textKey":"block3.subtitle",
"imageName":"truck3"
}
]
}
}

View File

@@ -4,6 +4,10 @@ router.get("/game-page", (request, response) => {
response.send(require("./json/gamepage/success.json"));
});
router.get("/update-like", (request, response) => {
response.send(require("./json/gamepage/success.json"));
});
router.get("/categories", (request, response) => {
response.send(require("./json/categories/success.json"));
});
@@ -16,4 +20,73 @@ router.get("/home", (request, response) => {
response.send(require("./json/home-page-data/success.json"));
});
module.exports = router;
router.get("/all-games", (request, response) => {
response.send(require("./json/home-page-data/all-games.json"));
});
// // Маршрут для обновления лайков
// router.post("/update-like", (request, response) => {
// const { username, likes } = request.body;
// // Эмулируем успешное обновление лайков
// console.log(`Лайки для пользователя ${username} обновлены до ${likes}`);
// response.status(200).json({
// success: true,
// message: `Лайки для пользователя ${username} обновлены до ${likes}`,
// });
// });
const fs = require("fs").promises;
const path = require("path");
// Path to JSON file
const commentsFilePath = path.join(__dirname, "./json/gamepage/success.json");
// Read JSON file
async function readComments() {
const data = await fs.readFile(commentsFilePath, "utf-8");
const parsedData = JSON.parse(data);
console.log("Прочитанные данные:", parsedData); // Логируем полученные данные
return parsedData;
}
// Write to JSON file
async function writeComments(data) {
await fs.writeFile(commentsFilePath, JSON.stringify(data, null, 2), "utf-8");
}
// Update likes route
router.post("/update-like", async (req, res) => {
const { username, likes } = req.body;
if (!username || likes === undefined) {
return res.status(400).json({ success: false, message: "Invalid input" });
}
try {
const data = await readComments();
const comment = data.data.comments.find((c) => c.username === username);
if (comment) {
comment.likes = likes;
await writeComments(data); // Сохраняем обновленные данные в файл
// Возвращаем актуализированные данные
res.status(200).json({
success: true,
message: "Likes updated successfully",
data: data.data, // Возвращаем актуализированные данные
});
} else {
res.status(404).json({ success: false, message: "Comment not found" });
}
} catch (error) {
console.error("Error updating likes:", error);
res.status(500).json({ success: false, message: "Server error" });
}
});
module.exports = router;

View File

@@ -8,14 +8,18 @@
"price": 259,
"old_price": 500,
"image": "sales_game1",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 2,
"title": "Red Solstice 2 Survivors",
"price": 561,
"image": "sales_game2",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 3,
@@ -23,7 +27,9 @@
"price": 820,
"old_price": 1100,
"image": "new_game2",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 4,
@@ -31,7 +37,9 @@
"price": 990,
"old_price": 1200,
"image": "leaders_game4",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 5,
@@ -39,7 +47,9 @@
"price": 1200,
"old_price": 2500,
"image": "leaders_game5",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 6,
@@ -47,31 +57,39 @@
"price": 600,
"old_price": 890,
"image": "leaders_game6",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
}
],
"games2": [
{
"id": 1,
"id": 7,
"title": "Alpha League",
"price": 299,
"image": "new_game1",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 2,
"id": 8,
"title": "Sons Of The Forests",
"price": 820,
"old_price": 1100,
"image": "new_game2",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 3,
"id": 9,
"title": "Pacific Drives",
"price": 1799,
"image": "new_game3",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 4,
@@ -79,7 +97,9 @@
"price": 990,
"old_price": 1200,
"image": "leaders_game4",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 5,
@@ -87,7 +107,9 @@
"price": 1200,
"old_price": 2500,
"image": "leaders_game5",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 6,
@@ -95,31 +117,39 @@
"price": 600,
"old_price": 890,
"image": "leaders_game6",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
}
],
"games3": [
{
"id": 1,
"id": 10,
"title": "Elden Ring",
"price": 3295,
"old_price": 3599,
"image": "leaders_game2",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 2,
"id": 11,
"title": "Counter-Strike 2",
"price": 479,
"image": "leaders_game1",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 3,
"id": 12,
"title": "PUBG: BATTLEGROUNDS",
"price": 199,
"image": "leaders_game3",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 4,
@@ -127,7 +157,9 @@
"price": 990,
"old_price": 1200,
"image": "leaders_game4",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 5,
@@ -135,7 +167,9 @@
"price": 1200,
"old_price": 2500,
"image": "leaders_game5",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 6,
@@ -143,7 +177,9 @@
"price": 600,
"old_price": 890,
"image": "leaders_game6",
"os": "windows"
"os": "windows",
"fav1": "star1",
"fav2": "star2"
}
]
}

View File

@@ -1,24 +1,35 @@
{
"success": true,
"data": {
"comments": [
{
"username": ользователь1",
"text": "Текст комментария 1"
},
{
"username": ользователь2",
"text": "Текст комментария 2"
},
{
"username": ользователь3",
"text": "Текст комментария 3"
},
{
"username": ользователь4",
"text": "Текст комментария 4"
}
]
}
"success": true,
"data": {
"comments": [
{
"username": ользователь1",
"text": "Текст комментария 1",
"likes": 9,
"rating": 8,
"date": "2025-03-01T10:00:00Z"
},
{
"username": ользователь2",
"text": "Текст комментария 2",
"likes": 7,
"rating": 7,
"date": "2025-01-01T10:00:00Z"
},
{
"username": ользователь3",
"text": "Текст комментария 3",
"likes": 5,
"rating": 3,
"date": "2025-02-01T10:00:00Z"
},
{
"username": ользователь4",
"text": "Текст комментария 4",
"likes": 15,
"rating": 2,
"date": "2025-12-01T10:00:00Z"
}
]
}
}

View File

@@ -0,0 +1,149 @@
{
"success": true,
"data": [
{
"id": 1,
"name": "The Witcher 3: Wild Hunt",
"image": "game1",
"text": "$10",
"imgPath": "img_top_1",
"description": "Эпическая RPG с открытым миром, в которой Геральт из Ривии охотится на монстров и раскрывает политические заговоры.",
"category": "RPG"
},
{
"id": 2,
"name": "Red Dead Redemption 2",
"image": "game2",
"text": "$10",
"imgPath": "img_top_2",
"description": "Приключенческая игра с открытым миром на Диком Западе, рассказывающая историю Артура Моргана.",
"category": "Adventures"
},
{
"id": 3,
"name": "Forza Horizon 5",
"image": "game3",
"text": "$10",
"imgPath": "img_top_3",
"description": "Гоночная игра с огромным открытым миром, действие которой происходит в Мексике.",
"category": "Race"
},
{
"id": 4,
"name": "Atomic Heart",
"image": "game4",
"text": "$10",
"imgPath": "img_top_4",
"description": "Экшен-шутер с элементами RPG, разворачивающийся в альтернативной Советской России.",
"category": "Shooters"
},
{
"id": 5,
"name": "Counter-Strike 2",
"image": "game5",
"text": "$10",
"imgPath": "img_top_5",
"description": "Популярный онлайн-шутер с соревновательным геймплеем и тактическими элементами.",
"category": "Shooters"
},
{
"id": 6,
"name": "Grand Theft Auto V",
"image": "game6",
"text": "$10",
"imgPath": "img_top_6",
"description": "Игра с открытым миром, где можно погрузиться в криминальный мир Лос-Сантоса.",
"category": "Adventures"
},
{
"id": 7,
"name": "Assassins Creed IV: Black Flag",
"image": "game7",
"text": "$10",
"imgPath": "img_top_7",
"description": "Приключенческая игра о пиратах и морских сражениях в эпоху золотого века пиратства.",
"category": "Adventures"
},
{
"id": 8,
"name": "Spider-Man",
"image": "game8",
"text": "$10",
"imgPath": "img_top_8",
"description": "Игра о супергерое Человеке-пауке с захватывающими битвами и паркуром по Нью-Йорку.",
"category": "Action"
},
{
"id": 9,
"name": "Assassins Creed Mirage",
"image": "game9",
"text": "$10",
"imgPath": "img_top_9",
"description": "Приключенческая игра с упором на скрытность, вдохновленная классическими частями серии.",
"category": "Action"
},
{
"id": 10,
"name": "Assassins Creed Valhalla",
"image": "game10",
"text": "$10",
"imgPath": "img_top_10",
"description": "RPG с открытым миром о викингах, включающая битвы, исследования и строительство поселений.",
"category": "RPG"
},
{
"id": 11,
"name": "ARK: Survival Evolved",
"image": "game11",
"text": "$10",
"imgPath": "img_top_11",
"description": "Выживание в открытом мире с динозаврами, строительством и многопользовательскими элементами.",
"category": "Simulators"
},
{
"id": 12,
"name": "FIFA 23",
"image": "game12",
"text": "$10",
"imgPath": "img_top_12",
"description": "Популярный футбольный симулятор с улучшенной графикой и реалистичным геймплеем.",
"category": "Sports"
},
{
"id": 13,
"name": "Dirt 5",
"image": "game13",
"text": "$10",
"imgPath": "img_top_13",
"description": "Аркадная гоночная игра с фокусом на ралли и внедорожных соревнованиях.",
"category": "Race"
},
{
"id": 14,
"name": "Cyberpunk 2077",
"image": "game14",
"text": "$10",
"imgPath": "img_top_14",
"description": "RPG в киберпанк-сеттинге с нелинейным сюжетом и детализированным открытым миром.",
"category": "RPG"
},
{
"id": 15,
"name": "Age of Empires IV",
"image": "game15",
"text": "$10",
"imgPath": "img_top_15",
"description": "Классическая стратегия в реальном времени с историческими кампаниями.",
"category": "Strategies"
},
{
"id": 16,
"name": "Civilization VI",
"image": "game16",
"text": "$10",
"imgPath": "img_top_16",
"description": "Глобальная пошаговая стратегия, в которой игроки строят и развивают цивилизации.",
"category": "Strategies"
}
]
}

View File

@@ -4,87 +4,115 @@
"topSail": [
{
"image": "game1",
"text": "$10"
"text": "$10",
"imgPath": "img_top_1"
},
{
"image": "game2",
"text": "$10"
"text": "$10",
"imgPath": "img_top_2"
},
{
"image": "game3",
"text": "$10"
"text": "$10",
"imgPath": "img_top_3"
},
{
"image": "game4",
"text": "$10"
"text": "$10",
"imgPath": "img_top_4"
},
{
"image": "game5",
"text": "$10"
"text": "$10",
"imgPath": "img_top_5"
},
{
"image": "game6",
"text": "$10"
"text": "$10",
"imgPath": "img_top_6"
},
{
"image": "game7",
"text": "$10"
"text": "$10",
"imgPath": "img_top_7"
},
{
"image": "game8",
"text": "$10"
"text": "$10",
"imgPath": "img_top_8"
}
],
"categories": [
{
"image": "category1",
"text": "гонки"
"text": "гонки",
"imgPath": "img_categories_1",
"category": "Race"
},
{
"image": "category2",
"text": "глубокий сюжет"
"text": "глубокий сюжет",
"imgPath": "img_categories_2",
"category": ""
},
{
"image": "category3",
"text": "симуляторы"
"text": "симуляторы",
"imgPath": "img_categories_3",
"category": "Simulators"
},
{
"image": "category4",
"text": "открытый мир"
"text": "открытый мир",
"imgPath": "img_categories_4",
"category": "RPG"
},
{
"image": "category5",
"text": "экшен"
"text": "экшен",
"imgPath": "img_categories_5",
"category": "Action"
},
{
"image": "category6",
"text": "стратегии"
"text": "стратегии",
"imgPath": "img_categories_6",
"category": "Strategies"
},
{
"image": "category7",
"text": "шутеры"
"text": "шутеры",
"imgPath": "img_categories_7",
"category": "Shooters"
},
{
"image": "category8",
"text": "приключения"
"text": "приключения",
"imgPath": "img_categories_8",
"category": "Adventures"
}
],
"news": [
{
"image": "news1",
"text": "Разработчики Delta Force: Hawk Ops представили крупномасштабный режим Havoc Warfare"
"text": "Разработчики Delta Force: Hawk Ops представили крупномасштабный режим Havoc Warfare",
"imgPath": "img_news_1"
},
{
"image": "news2",
"text": "Первый трейлер Assassins Creed Shadows — с темнокожим самураем в феодальной Японии"
"text": "Первый трейлер Assassins Creed Shadows — с темнокожим самураем в феодальной Японии",
"imgPath": "img_news_2"
},
{
"image": "news3",
"text": "Призрак Цусимы» вышел на ПК — и уже ставит рекорды для Sony"
"text": "Призрак Цусимы» вышел на ПК — и уже ставит рекорды для Sony",
"imgPath": "img_news_3"
},
{
"image": "news4",
"text": "Авторы Skull and Bones расширяют планы на второй сезо"
"text": "Авторы Skull and Bones расширяют планы на второй сезо",
"imgPath": "img_news_4"
}
]
}

View File

@@ -1,12 +1,17 @@
[
{
"id": 0,
"description": "1000 часто используемых",
"description": "10 часто используемых",
"imageFilename": "kart1.jpg"
},
{
"id": 1,
"description": "10 слов в Data Science",
"imageFilename": "kart1.jpg"
},
{
"id": 2,
"description": "IT Basics Dictionary",
"imageFilename": "kart1.jpg"
}
]

View File

@@ -146,5 +146,130 @@
]
}
]
},
{
"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."
]
}
]
}
]

View File

@@ -1,3 +1,5 @@
const fs = require('fs');
const path = require('path');
const router = require("express").Router();
module.exports = router;
@@ -9,6 +11,59 @@ 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
}
const 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);

View File

@@ -1,13 +1,15 @@
const router = require("express").Router();
const dictionariesRouter = require("./dictionaries");
const unitsRouter = require('./units');
module.exports = router;
const delay =
(ms = 1000) =>
(ms = 250) =>
(req, res, next) => {
setTimeout(next, ms);
};
router.use(delay());
router.use("/dictionaries", dictionariesRouter);
router.use('/units', unitsRouter);

View 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.

View File

@@ -0,0 +1 @@
[{"id":0,"filename":"unit-1","name":"Unit 1: Multifunctional Verbs: Be, Have, and Do"}]

View 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 });
});

View File

@@ -2,6 +2,7 @@ const { Router } = require('express')
const router = Router()
router.use('/eng-it-lean', require('./eng-it-lean/index'))
router.use('/sberhubproject', require('./sberhubproject/index'))
module.exports = router

View File

@@ -0,0 +1,17 @@
const router = require('express').Router();
const interestsRouter = require('./interests');
const usersRouter = require('./users');
module.exports = router;
const delay =
(ms = 1000) =>
(req, res, next) => {
setTimeout(next, ms);
};
router.use(delay());
router.use('/interests', interestsRouter);
router.use('/users', usersRouter);
router.use('/users/:id', usersRouter);

View File

@@ -0,0 +1,19 @@
[
{"value":"Стартапы, поиск команды и нетворкинг", "label":"Стартапы, поиск команды и нетворкинг"},
{"value":"Искусство, фотография и дизайн", "label":"Искусство, фотография и дизайн"},
{"value":"Музыка", "label":"Музыка"},
{"value":"Хореография", "label":"Хореография"},
{"value":"Спорт, фитнес и ЗОЖ", "label":"Спорт, фитнес и ЗОЖ"},
{"value":"Литература и история", "label":"Литература и история"},
{"value":"Политика, социология, активизм и дебаты", "label":"Политика, социология, активизм и дебаты"},
{"value":"Кино и другое многомодальное искусство", "label":"Кино и другое многомодальное искусство"},
{"value":"Психология и психическое здоровье", "label":"Психология и психическое здоровье"},
{"value":"Соревновательные видеоигры", "label":"Соревновательные видеоигры"},
{"value":"Новые технологии, ИИ, техника", "label":"Новые технологии, ИИ, техника"},
{"value":"Математика, физика и информатика", "label":"Математика, физика и информатика"},
{"value" :"Волонтерство и благотворительность", "label": "Волонтерство и благотворительность"},
{"value" :"Настольные игры", "label": "Настольные игры"},
{"value" :"Путешествия и туризм", "label": "Путешествия и туризм"},
{"value" :"Английский (иностранные языки)", "label": "Английский (иностранные языки)"},
{"value" :"Цифровые кафедры", "label": "Цифровые кафедры"}
]

View File

@@ -0,0 +1,12 @@
const router = require('express').Router();
module.exports = router;
const data = require('./data/interest.json');
router.get('/', (req, res) => {
//res.status(500).send({
// message: 'Internal server error'
//});
res.json(data)
});

View File

@@ -0,0 +1,113 @@
[
{
"id": 1252744945,
"username": "Иван Иванов",
"photo": "https://example.com/photos/1.jpg",
"about": "Разработчик с 10-летним стажем, увлекаюсь новыми технологиями.",
"email": "ivan.ivanov@example.com",
"interests": [
{ "value": "Новые технологии, ИИ, техника", "label": "Новые технологии, ИИ, техника" },
{ "value": "Музыка", "label": "Музыка" }
]
},
{
"id": 2,
"username": "Мария Смирнова",
"photo": "https://example.com/photos/2.jpg",
"about": "Люблю путешествия и фотографию, обожаю изучать новые культуры.",
"email": "maria.smirnova@example.com",
"interests": [
{ "value": "Путешествия и туризм", "label": "Путешествия и туризм" },
{ "value": "Искусство, фотография и дизайн", "label": "Искусство, фотография и дизайн" }
]
},
{
"id": 3,
"username": "Алексей Кузнецов",
"photo": "https://example.com/photos/3.jpg",
"about": "Финансовый аналитик, интересуюсь инвестициями и рынками.",
"email": "aleksey.kuznetsov@example.com",
"interests": [
{ "value": "Политика, социология, активизм и дебаты", "label": "Политика, социология, активизм и дебаты" },
{ "value": "Математика, физика и информатика", "label": "Математика, физика и информатика" }
]
},
{
"id": 4,
"username": "Ольга Петрова",
"photo": "https://example.com/photos/4.jpg",
"about": "Дизайнер интерьеров, люблю создавать уютные и стильные пространства.",
"email": "olga.petrovna@example.com",
"interests": [
{ "value": "Искусство, фотография и дизайн", "label": "Искусство, фотография и дизайн" },
{ "value": "Кино и другое многомодальное искусство", "label": "Кино и другое многомодальное искусство" }
]
},
{
"id": 5,
"username": "Дмитрий Сидоров",
"photo": "https://example.com/photos/5.jpg",
"about": "Тренер по фитнесу, придерживаюсь здорового образа жизни.",
"email": "dmitriy.sidorov@example.com",
"interests": [
{ "value": "Спорт, фитнес и ЗОЖ", "label": "Спорт, фитнес и ЗОЖ" },
{ "value": "Волонтерство и благотворительность", "label": "Волонтерство и благотворительность" }
]
},
{
"id": 6,
"username": "Елена Волкова",
"photo": "https://example.com/photos/6.jpg",
"about": "Психолог, занимаюсь личностным ростом и развитием.",
"email": "elena.volkova@example.com",
"interests": [
{ "value": "Психология и психическое здоровье", "label": "Психология и психическое здоровье" },
{ "value": "Литература и история", "label": "Литература и история" }
]
},
{
"id": 7,
"username": "Артем Морозов",
"photo": "https://example.com/photos/7.jpg",
"about": "Ведущий мероприятий и организатор, люблю работать с людьми.",
"email": "artem.morozov@example.com",
"interests": [
{ "value": "Настольные игры", "label": "Настольные игры" },
{ "value": "Кино и другое многомодальное искусство", "label": "Кино и другое многомодальное искусство" }
]
},
{
"id": 8,
"username": "Ирина Фёдорова",
"photo": "https://example.com/photos/8.jpg",
"about": "Веду блог о моде и стиле, увлекаюсь новыми трендами.",
"email": "irina.fedorova@example.com",
"interests": [
{ "value": "Мода", "label": "Мода" },
{ "value": "Путешествия и туризм", "label": "Путешествия и туризм" }
]
},
{
"id": 9,
"username": "Сергей Чернов",
"photo": "https://example.com/photos/9.jpg",
"about": "Разработчик мобильных приложений, увлекаюсь игровыми технологиями.",
"email": "sergey.chernov@example.com",
"interests": [
{ "value": "Соревновательные видеоигры", "label": "Соревновательные видеоигры" },
{ "value": "Новые технологии, ИИ, техника", "label": "Новые технологии, ИИ, техника" }
]
},
{
"id": 10,
"username": "Татьяна Лебедева",
"photo": "https://example.com/photos/10.jpg",
"about": "Работаю в области маркетинга, увлекаюсь продвижением брендов.",
"email": "tatyana.lebedeva@example.com",
"interests": [
{ "value": "Маркетинг", "label": "Маркетинг" },
{ "value": "Литература и история", "label": "Литература и история" }
]
}
]

View File

@@ -0,0 +1,39 @@
const router = require('express').Router();
module.exports = router;
const data = require('./data/users.json');
router.get('/', (req, res) => {
//res.status(500).send({
// message: 'Internal server error'
//});
res.json(data)
});
router.get('/:id', (req, res) => {
//res.status(500).send({
// message: 'Internal server error'
//});
const userId = parseInt(req.params.id);
res.json(data.find(item => item.id = userId));
});
router.post('/', (req, res) => {
//res.status(500).send({
// message: 'Internal server error'
//});
const data = req.body;
res.status(200).send();
});
router.put('/:id', (req, res) => {
//res.status(500).send({
// message: 'Internal server error'
//});
const userId = parseInt(req.params.id);
const data = req.body;
res.status(200).send();
});

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 911 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1015 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 812 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 955 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 711 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 967 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 935 B

Some files were not shown because too many files have changed in this diff Show More