perf: 支持企业微信群聊机器人通知

This commit is contained in:
xiaojunnuo
2024-11-23 23:58:31 +08:00
parent 5450246f06
commit b805a29259
19 changed files with 163 additions and 41 deletions

View File

@@ -23,6 +23,9 @@ import dayjs from 'dayjs';
import { DbAdapter } from '../../db/index.js';
import { isPlus } from '@certd/plus-core';
import { logger } from '@certd/basic';
import { UrlService } from './url-service.js';
import { NotificationService } from './notification-service.js';
import { NotificationGetter } from './notification-getter.js';
const runningTasks: Map<string | number, Executor> = new Map();
const freeCount = 10;
@@ -63,6 +66,12 @@ export class PipelineService extends BaseService<PipelineEntity> {
@Config('certd')
private certdConfig: any;
@Inject()
urlService: UrlService;
@Inject()
notificationService: NotificationService;
@Inject()
dbAdapter: DbAdapter;
@@ -384,6 +393,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
};
const accessGetter = new AccessGetter(userId, this.accessService.getById.bind(this.accessService));
const cnameProxyService = new CnameProxyService(userId, this.cnameRecordService.getWithAccessByDomain.bind(this.cnameRecordService));
const notificationGetter = new NotificationGetter(userId, this.notificationService.getById.bind(this.notificationService));
const executor = new Executor({
user,
pipeline,
@@ -393,6 +403,8 @@ export class PipelineService extends BaseService<PipelineEntity> {
pluginConfigService: this.pluginConfigGetter,
storage: new DbStorage(userId, this.storageService),
emailService: this.emailService,
urlService: this.urlService,
notificationService: notificationGetter,
fileRootDir: this.certdConfig.fileRootDir,
});
try {