web-service/apps/freeblox-web-service/src/services/auth/auth.controller.ts

27 lines
581 B
TypeScript
Raw Normal View History

2023-06-29 14:13:57 +00:00
import {
Body,
ClassSerializerInterceptor,
Controller,
Inject,
Post,
UseInterceptors,
} from '@nestjs/common';
import { ClientProxy } from '@nestjs/microservices';
import { ApiTags } from '@nestjs/swagger';
import { LoginDto } from './dtos/login.dto';
@Controller({
version: '1',
path: 'auth',
})
@ApiTags('Auth')
@UseInterceptors(ClassSerializerInterceptor)
export class AuthController {
constructor(@Inject('auth') private auth: ClientProxy) {}
@Post('login')
async login(@Body() body: LoginDto) {
return this.auth.send('auth.login', { body });
}
}