Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7ac265e3b | ||
|
|
d46841c21f | ||
|
|
940349af29 | ||
|
|
268824c108 | ||
|
|
550554a7a5 | ||
|
|
f5a8585845 | ||
|
|
1e67f25066 | ||
|
|
bbc315e270 | ||
|
|
9d3edcf0dd |
No files matched your search
+2
-1
@@ -12,7 +12,8 @@ services:
|
|||||||
# ports:
|
# ports:
|
||||||
# - 27017:27017
|
# - 27017:27017
|
||||||
multy-stubs:
|
multy-stubs:
|
||||||
build: .
|
# build: .
|
||||||
|
image: bro.js/ms/bh:$TAG
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 8044:8044
|
- 8044:8044
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ app.use(require('./root'))
|
|||||||
*/
|
*/
|
||||||
app.use('/epja-2024-1', require('./routers/epja-2024-1'))
|
app.use('/epja-2024-1', require('./routers/epja-2024-1'))
|
||||||
app.use('/todo', require('./routers/todo/routes'))
|
app.use('/todo', require('./routers/todo/routes'))
|
||||||
|
app.use('/dogsitters-finder', require('./routers/dogsitters-finder'))
|
||||||
|
app.use('/kazan-explore', require('./routers/kazan-explore'))
|
||||||
|
|
||||||
app.use(require('./error'))
|
app.use(require('./error'))
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
const { response } = require('express');
|
||||||
|
|
||||||
|
const router = require('express').Router();
|
||||||
|
|
||||||
|
router.get("/users", (request, response) => {
|
||||||
|
response.send(require("./json/users/users.json"))
|
||||||
|
})
|
||||||
|
|
||||||
|
router.post("/auth", (request, response) => {
|
||||||
|
const {phoneNumber, password} = request.body;
|
||||||
|
console.log(phoneNumber, password);
|
||||||
|
if (phoneNumber === '89999999999') {
|
||||||
|
response.send(require("./json/auth/dogsitter.success.json"))
|
||||||
|
}
|
||||||
|
else if (phoneNumber === '89555555555') {
|
||||||
|
response.status(400).send(require("./json/auth/error.json"))
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
response.send(require("./json/auth/owner.success.json"))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
router.post("/register", (request, response) => {
|
||||||
|
const {firstName, secondName, phoneNumber, password, role} = request.body;
|
||||||
|
console.log(phoneNumber, password, role);
|
||||||
|
if (phoneNumber === '89283244141' || phoneNumber === '89872855893') {
|
||||||
|
response.status(400).send(require("./json/register/error.json"))
|
||||||
|
}
|
||||||
|
else if (role === 'dogsitter') {
|
||||||
|
response.send(require("./json/register/dogsitter.success.json"))
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
response.send(require("./json/register/owner.success.json"))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
module.exports = router;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"id": 1,
|
||||||
|
"phoneNumber": 89283244141,
|
||||||
|
"firstName": "Вася",
|
||||||
|
"secondName": "Пупкин",
|
||||||
|
"role": "dogsitter",
|
||||||
|
"location": "Россия, республика Татарстан, Казань, улица Пушкина, 12",
|
||||||
|
"price": 1500,
|
||||||
|
"aboutMe": "Я люблю собак"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"error": "Пользователь не найден"
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"id": 3,
|
||||||
|
"phoneNumber": 89872855893,
|
||||||
|
"firstName": "Гадий",
|
||||||
|
"secondName": "Петрович",
|
||||||
|
"role": "owner"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"id": 5,
|
||||||
|
"phoneNumber": 89555555555,
|
||||||
|
"firstName": "Масяня",
|
||||||
|
"secondName": "Карлова",
|
||||||
|
"role": "dogsitter",
|
||||||
|
"location": "Россия, республика Татарстан, Казань, улица Пушкина, 12",
|
||||||
|
"price": 100,
|
||||||
|
"aboutMe": "Все на свете - собаки"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"error": "Пользователь с таким номером телефона уже существует"
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"id": 6,
|
||||||
|
"phoneNumber": 89888888888,
|
||||||
|
"firstName": "Генадий",
|
||||||
|
"secondName": "Паровозов",
|
||||||
|
"role": "owner"
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-5
@@ -2,7 +2,6 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"phone_number": 89283244141,
|
"phone_number": 89283244141,
|
||||||
"password": "1234",
|
|
||||||
"first_name": "Вася",
|
"first_name": "Вася",
|
||||||
"second_name": "Пупкин",
|
"second_name": "Пупкин",
|
||||||
"role": "dogsitter",
|
"role": "dogsitter",
|
||||||
@@ -13,7 +12,6 @@
|
|||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"phone_number": 89272844541,
|
"phone_number": 89272844541,
|
||||||
"password": "1234",
|
|
||||||
"first_name": "Ваня",
|
"first_name": "Ваня",
|
||||||
"second_name": "Пуськин",
|
"second_name": "Пуськин",
|
||||||
"role": "dogsitter",
|
"role": "dogsitter",
|
||||||
@@ -24,7 +22,6 @@
|
|||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"phone_number": 89872855893,
|
"phone_number": 89872855893,
|
||||||
"password": "12345",
|
|
||||||
"first_name": "Гадий",
|
"first_name": "Гадий",
|
||||||
"second_name": "Петрович",
|
"second_name": "Петрович",
|
||||||
"role": "owner"
|
"role": "owner"
|
||||||
@@ -32,10 +29,9 @@
|
|||||||
{
|
{
|
||||||
"id": 4,
|
"id": 4,
|
||||||
"phone_number": 89872844591,
|
"phone_number": 89872844591,
|
||||||
"password": "12345",
|
|
||||||
"first_name": "Галкин",
|
"first_name": "Галкин",
|
||||||
"second_name": "Максим",
|
"second_name": "Максим",
|
||||||
"role": ["owner", "dogsitter"],
|
"role": "dogsitter",
|
||||||
"location": "Россия, республика Татарстан, Казань, проспект Ямашева, 83",
|
"location": "Россия, республика Татарстан, Казань, проспект Ямашева, 83",
|
||||||
"price": 1000000,
|
"price": 1000000,
|
||||||
"about_me": "Миллион алых роз"
|
"about_me": "Миллион алых роз"
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,9 +0,0 @@
|
|||||||
const { response } = require('express');
|
|
||||||
|
|
||||||
const router = require('express').Router();
|
|
||||||
|
|
||||||
router.get("/users", (request, response) => {
|
|
||||||
response.send(require("./json/users.json"))
|
|
||||||
})
|
|
||||||
|
|
||||||
module.exports = router;
|
|
||||||
Reference in new issue
Block a user