feat: midway注解方式编写插件

This commit is contained in:
xiaojunnuo
2022-12-29 23:52:51 +08:00
parent 717d203622
commit e4ec4e1404
30 changed files with 506 additions and 446 deletions
@@ -1,8 +1,7 @@
import { IAccessService, IsTaskPlugin, RunStrategy, TaskInput, ITaskPlugin } from "@certd/pipeline";
import { IAccessService, IsTaskPlugin, RunStrategy, TaskInput, ITaskPlugin, LOGGER } from "@certd/pipeline";
import tencentcloud from "tencentcloud-sdk-nodejs/index";
import { TencentAccess } from "../../access";
import { Inject } from "@midwayjs/decorator";
import { ILogger } from "@midwayjs/core";
@IsTaskPlugin({
name: "DeployCertToTencentCDN",
@@ -52,7 +51,10 @@ export class DeployToCdnPlugin implements ITaskPlugin {
accessService!: IAccessService;
@Inject()
logger!: ILogger;
logger!: LOGGER;
// eslint-disable-next-line @typescript-eslint/no-empty-function
async onInit() {}
async execute(): Promise<void> {
const accessProvider: TencentAccess = (await this.accessService.getById(this.accessId)) as TencentAccess;