17 lines
512 B
TypeScript
17 lines
512 B
TypeScript
|
import { Body, Controller, Post } from '@nestjs/common'
|
||
|
import { EmailService } from './email.service'
|
||
|
import { ApiTags, ApiOperation } from '@nestjs/swagger'
|
||
|
import { EmailDto } from './dto/email.dto'
|
||
|
|
||
|
@ApiTags('Email')
|
||
|
@Controller('api/email')
|
||
|
export class EmailController {
|
||
|
constructor(private readonly emailService: EmailService) {}
|
||
|
|
||
|
@ApiOperation({ summary: '发送邮件' })
|
||
|
@Post('test')
|
||
|
async sendEmailTo(@Body() payload: EmailDto) {
|
||
|
return this.emailService.sendEmailTo(payload.email)
|
||
|
}
|
||
|
}
|