direct login
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { Controller, Get, Post, Body, Param, Delete } from '@nestjs/common';
|
||||
import { DPageService } from './dpage.service';
|
||||
import { LoginDto } from './dto/login.dto';
|
||||
import { UserDec } from '../../common/decorators/user.decorator';
|
||||
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { AuthGuards } from '../../common/decorators/auth-guard.decorator';
|
||||
|
||||
@Controller('dpage')
|
||||
@ApiTags('d-page')
|
||||
@AuthGuards()
|
||||
@ApiBearerAuth()
|
||||
export class DpageController {
|
||||
constructor(private readonly dpageService: DPageService) { }
|
||||
|
||||
@Post('login')
|
||||
@ApiOperation({ summary: 'direct login' })
|
||||
login(@Body() dto: LoginDto, @UserDec("id") userId: string) {
|
||||
return this.dpageService.loginToDpage(dto, userId);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.dpageService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.dpageService.findOne(+id);
|
||||
}
|
||||
|
||||
// @Patch(':id')
|
||||
// update(@Param('id') id: string, @Body() updateDpageDto: UpdateDpageDto) {
|
||||
// return this.dpageService.update(id, updateDpageDto);
|
||||
// }
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.dpageService.remove(+id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user