mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
perf: 通知管理
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { BaseNotification, IsNotification, NotificationBody, NotificationInput } from '@certd/pipeline';
|
||||
|
||||
@IsNotification({
|
||||
name: 'email',
|
||||
title: '电子邮件',
|
||||
desc: '电子邮件通知',
|
||||
})
|
||||
export class EmailNotification extends BaseNotification {
|
||||
@NotificationInput({
|
||||
title: '收件人邮箱',
|
||||
component: {
|
||||
name: 'a-select',
|
||||
vModel: 'value',
|
||||
mode: 'tags',
|
||||
open: false,
|
||||
},
|
||||
required: true,
|
||||
helper: '可以填写多个,填写一个按回车键再填写下一个',
|
||||
})
|
||||
receivers!: string[];
|
||||
|
||||
async send(body: NotificationBody) {
|
||||
await this.ctx.emailService.send({
|
||||
userId: body.userId,
|
||||
subject: body.title,
|
||||
content: body.content,
|
||||
receivers: this.receivers,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user