feat(src/modules/cities/cities.controller.ts): добавляет ответы API для получения всех городов и районов

 feat(src/modules/chat/chat.controller.ts): добавляет ответы API для создания чата и получения сообщений

 feat(src/modules/greetings/greetings.controller.ts): добавляет ответы API для получения и создания приветствий

 feat(src/modules/likes/likes.controller.ts): добавляет ответы API для создания лайков и получения совпадений

 feat(src/modules/reports/reports.controller.ts): добавляет ответы API для создания и получения отчетов

 feat(src/modules/feed/feed.controller.ts): добавляет ответ API для получения отфильтрованного фида

 feat(src/auth/auth.controller.ts): добавляет ответы API для регистрации, входа и выхода пользователей

 feat(src/modules/media/media.controller.ts): добавляет ответы API для загрузки и получения медиа

 feat(src/modules/users/users.controller.ts): добавляет ответы API для получения текущего пользователя и управления пользователями

 feat(src/modules/tags/tags.controller.ts): добавляет ответы API для получения и создания тегов

 feat(src/modules/profiles/profiles.controller.ts): добавляет ответы API для управления профилями пользователей

 feat(src/modules/dates/dates.controller.ts): добавляет ответы API для создания и получения встреч
This commit is contained in:
Oscar
2026-06-08 14:22:50 +03:00
parent bc3e48bcad
commit 102b6b4026
24 changed files with 598 additions and 12 deletions

View File

@@ -1,12 +1,14 @@
import { Body, Controller, Post, UseGuards } from '@nestjs/common';
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import { AuthService } from './auth.service';
import { LoginDto } from './dto/login.dto';
import { RefreshTokenDto } from './dto/refresh-token.dto';
import { RegisterDto } from './dto/register.dto';
import { TokensResponseDto } from './dto/tokens-response.dto';
import { Public } from '../common/decorators/public.decorator';
import { CurrentUser } from '../common/decorators/current-user.decorator';
import { JwtAuthGuard } from '../common/guards/jwt-auth.guard';
import { MessageResponseDto } from '../common/dto/message-response.dto';
@ApiTags('auth')
@Controller('auth')
@@ -16,6 +18,7 @@ export class AuthController {
@Public()
@Post('register')
@ApiOperation({ summary: 'Register new user' })
@ApiResponse({ status: 201, type: TokensResponseDto })
register(@Body() dto: RegisterDto) {
return this.authService.register(dto);
}
@@ -23,6 +26,7 @@ export class AuthController {
@Public()
@Post('login')
@ApiOperation({ summary: 'Login with phone and password' })
@ApiResponse({ status: 201, type: TokensResponseDto })
login(@Body() dto: LoginDto) {
return this.authService.login(dto);
}
@@ -31,6 +35,7 @@ export class AuthController {
@Post('logout')
@ApiBearerAuth()
@ApiOperation({ summary: 'Logout current user' })
@ApiResponse({ status: 201, type: MessageResponseDto })
logout(@CurrentUser('id') userId: string) {
return this.authService.logout(userId);
}
@@ -38,6 +43,7 @@ export class AuthController {
@Public()
@Post('refresh')
@ApiOperation({ summary: 'Refresh access token' })
@ApiResponse({ status: 201, type: TokensResponseDto })
refresh(@Body() dto: RefreshTokenDto) {
return this.authService.refreshTokens(dto.refreshToken);
}
@@ -46,6 +52,7 @@ export class AuthController {
@Post('fcm-token')
@ApiBearerAuth()
@ApiOperation({ summary: 'Update FCM push token' })
@ApiResponse({ status: 201, type: MessageResponseDto })
updateFcmToken(
@CurrentUser('id') userId: string,
@Body('fcmToken') fcmToken: string,

View File

@@ -0,0 +1,9 @@
import { ApiProperty } from '@nestjs/swagger';
export class TokensResponseDto {
@ApiProperty({ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' })
accessToken: string;
@ApiProperty({ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' })
refreshToken: string;
}