✨ feat(src/modules/greetings/greetings.controller.ts): обновляет ответы API для получения и создания фраз приветствия
✨ feat(src/modules/likes/likes.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/dates/dto/dates-response.dto.ts): изменяет название свойства статуса даты на dateStatus ✨ feat(src/modules/cities/cities.controller.ts): обновляет ответы API для получения и создания городов и районов ✨ feat(src/modules/chat/chat.controller.ts): обновляет ответы API для создания и получения чатов и сообщений ✨ feat(src/modules/reports/reports.controller.ts): обновляет ответы API для создания и получения отчетов ✨ feat(src/modules/feed/feed.controller.ts): обновляет структуру ответа
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Controller, Get, Query, UseGuards } from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { ApiBearerAuth, ApiExtraModels, ApiOkResponse, ApiOperation, ApiTags, getSchemaPath } from '@nestjs/swagger';
|
||||
import { CurrentUser } from '../../common/decorators/current-user.decorator';
|
||||
import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard';
|
||||
import { FeedFilterDto } from './dto/feed-filter.dto';
|
||||
@@ -9,13 +9,23 @@ import { ProfileResponseDto } from '../profiles/dto/profile-response.dto';
|
||||
@ApiTags('feed')
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiExtraModels(ProfileResponseDto)
|
||||
@Controller('feed')
|
||||
export class FeedController {
|
||||
constructor(private readonly feedService: FeedService) {}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'Get filtered feed (requires profileId)' })
|
||||
@ApiResponse({ status: 200, type: [ProfileResponseDto] })
|
||||
@ApiOkResponse({
|
||||
schema: {
|
||||
properties: {
|
||||
items: { type: 'array', items: { $ref: getSchemaPath(ProfileResponseDto) } },
|
||||
page: { type: 'number', example: 1 },
|
||||
limit: { type: 'number', example: 20 },
|
||||
},
|
||||
required: ['items', 'page', 'limit'],
|
||||
},
|
||||
})
|
||||
getFeed(@CurrentUser('id') userId: string, @Query() filter: FeedFilterDto) {
|
||||
return this.feedService.getFeed(userId, filter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user