mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
chore:
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import {ICertApplyUploadService} from "@certd/plugin-cert";
|
||||
import {IMidwayContext, Inject, Provide} from "@midwayjs/core";
|
||||
import {CertInfoService} from "../../monitor/index.js";
|
||||
import {CertUploadService} from "../../monitor/service/cert-upload-service.js";
|
||||
|
||||
@Provide("CertApplyUploadService")
|
||||
export class CertApplyUploadService implements ICertApplyUploadService {
|
||||
@Inject()
|
||||
ctx : IMidwayContext
|
||||
|
||||
async getCertInfo(opts: { certId: number; userId: number; }) {
|
||||
const certInfoService = this.ctx.getApp().getApplicationContext().get<CertInfoService>("CertInfoService")
|
||||
const { certId, userId } = opts;
|
||||
return await certInfoService.getCertInfo({
|
||||
certId,
|
||||
userId: Number(userId),
|
||||
});
|
||||
};
|
||||
async updateCert(opts: { certId: any; userId: any; cert: any; }){
|
||||
const certUploadService = this.ctx.getApp().getApplicationContext().get<CertUploadService>("CertUploadService")
|
||||
return await certUploadService.updateCert({
|
||||
id:opts.certId,
|
||||
userId:opts.userId,
|
||||
cert:opts.cert
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,6 +36,7 @@ import { NotificationService } from "./notification-service.js";
|
||||
import { NotificationGetter } from "./notification-getter.js";
|
||||
import { UserSuiteEntity, UserSuiteService } from "@certd/commercial-core";
|
||||
import { CertInfoService } from "../../monitor/service/cert-info-service.js";
|
||||
import {CertApplyUploadService} from "./cert-apply-upload-service.js";
|
||||
|
||||
const runningTasks: Map<string | number, Executor> = new Map();
|
||||
|
||||
@@ -92,6 +93,8 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
@Inject()
|
||||
certInfoService: CertInfoService;
|
||||
|
||||
@Inject()
|
||||
certApplyUploadService: CertApplyUploadService;
|
||||
//@ts-ignore
|
||||
getRepository() {
|
||||
return this.repository;
|
||||
@@ -481,7 +484,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
sysInfo.title = siteInfo.title;
|
||||
}
|
||||
const serviceContainer = {
|
||||
CertInfoService: this.certInfoService
|
||||
CertApplyUploadService: this.certApplyUploadService
|
||||
}
|
||||
const serviceGetter = {
|
||||
get:(name: string) => {
|
||||
|
||||
Reference in New Issue
Block a user