perf: 优化证书申请成功通知发送方式

This commit is contained in:
xiaojunnuo
2024-11-27 12:36:28 +08:00
parent 7e5ea0cee0
commit 8002a56efc
24 changed files with 382 additions and 42 deletions
@@ -6,13 +6,13 @@ import * as _ from "lodash-es";
import { IEmailService } from "../service/index.js";
export type NotificationBody = {
userId: number;
userId?: number;
title: string;
content: string;
pipeline: Pipeline;
pipelineId: number;
pipeline?: Pipeline;
pipelineId?: number;
result?: HistoryResult;
historyId: number;
historyId?: number;
errorMessage?: string;
url?: string;
};
@@ -39,6 +39,7 @@ export type NotificationDefine = Registrable & {
export type NotificationInstanceConfig = {
id: number;
type: string;
name: string;
userId: number;
setting: {
[key: string]: any;
@@ -47,6 +48,7 @@ export type NotificationInstanceConfig = {
export interface INotificationService {
getById(id: number): Promise<NotificationInstanceConfig>;
getDefault(): Promise<NotificationInstanceConfig>;
}
export interface INotification {
@@ -97,7 +99,7 @@ export abstract class BaseNotification implements INotification {
async onTestRequest() {
await this.send({
userId: 0,
title: "【Certd】测试通知",
title: "【Certd】测试通知,标题长度测试、测试、测试",
content: "测试通知",
pipeline: {
id: 1,