perf: 支持webhook触发流水线,新增触发类型图标显示

This commit is contained in:
xiaojunnuo
2026-01-09 01:10:43 +08:00
parent 2b353094eb
commit 1a29541140
17 changed files with 347 additions and 97 deletions
@@ -0,0 +1,19 @@
import { BaseController, Constants } from '@certd/lib-server';
import { Controller, Get, Inject, Param, Post, Provide } from '@midwayjs/core';
import { PipelineService } from '../../modules/pipeline/service/pipeline-service.js';
/**
*/
@Provide()
@Controller('/api/webhook/')
export class WebhookController extends BaseController {
@Inject()
pipelineService: PipelineService;
@Get('/:webhookKey', { summary: Constants.per.guest })
@Post('/:webhookKey', { summary: Constants.per.guest })
async webhook(@Param('webhookKey') webhookKey: string): Promise<any> {
await this.pipelineService.triggerByWebhook(webhookKey);
return this.ok({});
}
}