42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { Controller, Get, Post, Body, Query } 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';
|
|
import { FindBusinessesDto } from './dto/find-businesses.dto';
|
|
|
|
@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('business/list')
|
|
findAll(@Query() dto: FindBusinessesDto) {
|
|
return this.dpageService.findAll(dto);
|
|
}
|
|
|
|
// @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);
|
|
// }
|
|
}
|