2024-07-15 00:30:33 +08:00
|
|
|
import { Body, Controller, Inject, Post, Provide } from '@midwayjs/core';
|
2024-10-03 22:03:49 +08:00
|
|
|
import { BaseController } from '@certd/lib-server';
|
2025-01-15 01:05:34 +08:00
|
|
|
import { EmailService } from '../../../modules/basic/service/email-service.js';
|
2024-10-03 22:03:49 +08:00
|
|
|
import { Constants } from '@certd/lib-server';
|
2023-06-25 15:30:18 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*/
|
|
|
|
|
@Provide()
|
|
|
|
|
@Controller('/api/basic/email')
|
|
|
|
|
export class EmailController extends BaseController {
|
|
|
|
|
@Inject()
|
|
|
|
|
emailService: EmailService;
|
|
|
|
|
|
2023-06-27 09:29:43 +08:00
|
|
|
@Post('/test', { summary: Constants.per.authOnly })
|
2024-12-11 11:30:32 +08:00
|
|
|
public async test(@Body('receiver') receiver) {
|
2023-06-25 15:30:18 +08:00
|
|
|
const userId = super.getUserId();
|
|
|
|
|
await this.emailService.test(userId, receiver);
|
|
|
|
|
return this.ok({});
|
|
|
|
|
}
|
|
|
|
|
}
|