import { Body, Controller, Get, Post, Query, UseGuards } from '@nestjs/common'; import { ApiBearerAuth, ApiCreatedResponse, ApiOkResponse, ApiOperation, ApiTags } from '@nestjs/swagger'; import { CurrentUser } from '../../common/decorators/current-user.decorator'; import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard'; import { CreateLikeDto } from './dto/create-like.dto'; import { CreateLikeResponseDto, MatchDto } from './dto/likes-response.dto'; import { LikesService } from './likes.service'; @ApiTags('likes') @ApiBearerAuth() @UseGuards(JwtAuthGuard) @Controller('likes') export class LikesController { constructor(private readonly likesService: LikesService) {} @Post() @ApiOperation({ summary: 'Like or dislike a profile' }) @ApiCreatedResponse({ type: CreateLikeResponseDto }) createLike(@CurrentUser('id') userId: string, @Body() dto: CreateLikeDto) { return this.likesService.createLike(userId, dto); } @Get('matches') @ApiOperation({ summary: 'Get matches for a profile' }) @ApiOkResponse({ type: [MatchDto] }) getMyMatches( @CurrentUser('id') userId: string, @Query('profileId') profileId: string, ) { return this.likesService.getMyMatches(userId, profileId); } }