import { Controller, Post, Body, HttpCode, HttpStatus } from '@nestjs/common'; import { AuthService } from './auth.service'; import { RegisterDto } from './dto/register.dto'; import { LoginDto } from './dto/login.dto'; import { Public } from './decorators/public.decorator'; @Controller('auth') export class AuthController { constructor(private readonly authService: AuthService) {} @Public() @Post('register') register(@Body() dto: RegisterDto) { return this.authService.register(dto); } @Public() @HttpCode(HttpStatus.OK) @Post('login') login(@Body() dto: LoginDto) { return this.authService.login(dto); } }