Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Завершаем проектировать базу данных #7

Merged
merged 23 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"watch": ["src"],
"ext": "ts, json",
"exec": "npm run ts ./src/main.rest.ts | pino-pretty --colorize --translateTime SYS:standard"
}
165 changes: 165 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
},
"main": "main.js",
"scripts": {
"start:dev": "npm run ts ./src/main.rest.ts | pino-pretty --colorize --translateTime SYS:standard",
"start": "npm run build && node ./dist/main.rest.js",
"start:dev": "nodemon",
"build": "npm run clean && npm run compile",
"lint": "eslint src/ --ext .ts",
"compile": "tsc -p tsconfig.json",
Expand All @@ -38,7 +39,8 @@
"tslib": "2.6.2",
"pino-pretty": "11.0.0",
"@types/convict": "6.1.6",
"@types/convict-format-with-validator": "6.0.5"
"@types/convict-format-with-validator": "6.0.5",
"nodemon": "3.1.0"
},
"type": "module",
"engines": {
Expand Down
21 changes: 19 additions & 2 deletions specification/specification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ paths:
parameters:
- in: path
name: offerId
example: adsduif874865fd
example: 6af6f711-c28d-4121-82cd-e0b462a27f00
description: id предложения
schema:
type: string
Expand Down Expand Up @@ -231,6 +231,23 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/OfferEntity'

/favorite/{offerId}/{status}:
parameters:
- in: path
name: offerId
example: 6af6f711-c28d-4121-82cd-e0b462a27f00
description: id предложения
schema:
type: string
required: true
- in: path
name: status
example: 1
description: 1 добавляет предложение в избранное, а 0 удаляет
schema:
type: number
required: true
post:
tags:
- offers
Expand All @@ -248,7 +265,7 @@ paths:
parameters:
- in: path
name: offerId
example: adsduif874865fd
example: 6af6f711-c28d-4121-82cd-e0b462a27f00
description: id предложения
schema:
type: string
Expand Down
4 changes: 3 additions & 1 deletion src/main.rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import 'reflect-metadata';
import { RestApplication } from './rest/rest-application.js';
import { createRestApplicationContainer } from './rest/rest-container.js';
import { createOfferContainer } from './shared/modules/offer/offer-container.js';
import { createReviewContainer } from './shared/modules/review/review-container.js';
import { createUserContainer } from './shared/modules/user/user-container.js';
import { Component } from './shared/types/component.enum.js';

async function bootstrap() {
const appContainer = Container.merge(
createRestApplicationContainer(),
createUserContainer(),
createOfferContainer()
createOfferContainer(),
createReviewContainer()
);

const application = appContainer.get<RestApplication>(
Expand Down
Loading
Loading