mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
chore: 目录调整,controller转移到外部单独的目录
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import { BaseService } from '@certd/lib-server';
|
||||
import { PluginEntity } from '../entity/plugin.js';
|
||||
import { InjectEntityModel } from '@midwayjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { checkComm } from '@certd/pipeline';
|
||||
import { BuiltInPluginService } from '../../pipeline/service/plugin-service.js';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Singleton)
|
||||
export class PluginService extends BaseService<PluginEntity> {
|
||||
@InjectEntityModel(PluginEntity)
|
||||
repository: Repository<PluginEntity>;
|
||||
|
||||
@Inject()
|
||||
builtInPluginService: BuiltInPluginService;
|
||||
|
||||
//@ts-ignore
|
||||
getRepository() {
|
||||
checkComm();
|
||||
return this.repository;
|
||||
}
|
||||
|
||||
async setDisabled(id: number, disabled: boolean) {
|
||||
await this.repository.update({ id }, { disabled });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user