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';
|
|
|
|
|
import { Constants } from '@certd/lib-server';
|
2025-01-19 01:07:20 +08:00
|
|
|
import { EmailService } from '../../../modules/basic/service/email-service.js';
|
2023-06-25 15:30:18 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*/
|
|
|
|
|
@Provide()
|
2025-01-19 01:07:20 +08:00
|
|
|
@Controller('/api/mine/email')
|
2023-06-25 15:30:18 +08:00
|
|
|
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({});
|
|
|
|
|
}
|
2025-05-31 00:45:54 +08:00
|
|
|
|
2025-12-14 01:36:20 +08:00
|
|
|
// @Post('/list', { summary: Constants.per.authOnly })
|
|
|
|
|
// public async list() {
|
|
|
|
|
// const userId = super.getUserId();
|
|
|
|
|
// const res = await this.emailService.list(userId);
|
|
|
|
|
// return this.ok(res);
|
|
|
|
|
// }
|
2025-05-31 00:45:54 +08:00
|
|
|
|
2025-12-14 01:36:20 +08:00
|
|
|
// @Post('/add', { summary: Constants.per.authOnly })
|
|
|
|
|
// public async add(@Body('email') email) {
|
|
|
|
|
// const userId = super.getUserId();
|
|
|
|
|
// await this.emailService.add(userId, email);
|
|
|
|
|
// return this.ok({});
|
|
|
|
|
// }
|
2025-05-31 00:45:54 +08:00
|
|
|
|
2025-12-14 01:36:20 +08:00
|
|
|
// @Post('/delete', { summary: Constants.per.authOnly })
|
|
|
|
|
// public async delete(@Body('email') email) {
|
|
|
|
|
// const userId = super.getUserId();
|
|
|
|
|
// await this.emailService.delete(userId, email);
|
|
|
|
|
// return this.ok({});
|
|
|
|
|
// }
|
2023-06-25 15:30:18 +08:00
|
|
|
}
|