mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
perf: 支持webhook触发流水线,新增触发类型图标显示
This commit is contained in:
@@ -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({});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user