mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 00:50:56 +00:00
Initial commit of edr-passenger-api alpha version
This commit is contained in:
18
apps/edr-passenger-api/src/modules/auth/auth.controller.ts
Normal file
18
apps/edr-passenger-api/src/modules/auth/auth.controller.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Body, Controller, Post } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||||
import { AuthService } from './auth.service';
|
||||
import { RegisterDto, LoginDto } from './auth.dto';
|
||||
|
||||
@ApiTags('Auth')
|
||||
@Controller('auth')
|
||||
export class AuthController {
|
||||
constructor(private service: AuthService) {}
|
||||
|
||||
@Post('register')
|
||||
@ApiOperation({ summary: 'Register new user' })
|
||||
register(@Body() dto: RegisterDto) { return this.service.register(dto); }
|
||||
|
||||
@Post('login')
|
||||
@ApiOperation({ summary: 'Login and get JWT' })
|
||||
login(@Body() dto: LoginDto) { return this.service.login(dto); }
|
||||
}
|
||||
Reference in New Issue
Block a user