mirror of
https://github.com/certd/certd.git
synced 2026-04-03 14:10:54 +08:00
Compare commits
1 Commits
d1a65922d7
...
v2_singlet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3a24ef6de |
@@ -14,7 +14,7 @@ export const uploadTmpFileCacheKey = 'tmpfile_key_';
|
||||
/**
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class FileService {
|
||||
async saveFile(userId: number, tmpCacheKey: any, permission: 'public' | 'private') {
|
||||
if (tmpCacheKey.startsWith(`/${permission}`)) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { IOcrService } from "@certd/plugin-lib";
|
||||
/**
|
||||
*/
|
||||
@Provide("ocrService")
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class OcrService implements IOcrService {
|
||||
@Inject()
|
||||
plusService: PlusService;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { SysInstallInfo, SysLicenseInfo, SysSettingsService } from '../../settin
|
||||
import { merge } from 'lodash-es';
|
||||
import fs from 'fs';
|
||||
@Provide("plusService")
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class PlusService {
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
@@ -10,7 +10,7 @@ import {EncryptService} from './encrypt-service.js';
|
||||
* 授权
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, {allowDowngrade: true})
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class AccessService extends BaseService<AccessEntity> {
|
||||
@InjectEntityModel(AccessEntity)
|
||||
repository: Repository<AccessEntity>;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { AddonEntity } from "../entity/addon.js";
|
||||
* Addon
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class AddonService extends BaseService<AddonEntity> {
|
||||
@InjectEntityModel(AddonEntity)
|
||||
repository: Repository<AddonEntity>;
|
||||
|
||||
@@ -7,7 +7,7 @@ import crypto from 'crypto';
|
||||
import {SafeService} from "../sys/settings/safe-service.js";
|
||||
|
||||
@Autoload()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class AutoAInitSite {
|
||||
@Inject()
|
||||
userService: UserService;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { logger } from "@certd/basic";
|
||||
import { PluginService } from "../plugin/service/plugin-service.js";
|
||||
|
||||
@Autoload()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class AutoBLoadPlugins {
|
||||
@Inject()
|
||||
pluginService: PluginService;
|
||||
|
||||
@@ -13,7 +13,7 @@ import {UserService} from "../sys/authority/service/user-service.js";
|
||||
import {Between} from "typeorm";
|
||||
|
||||
@Autoload()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class AutoCRegisterCron {
|
||||
@Inject()
|
||||
pipelineService: PipelineService;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { UserSuiteService } from '@certd/commercial-core';
|
||||
import { Autoload, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
|
||||
@Autoload()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class AutoDMitterRegister {
|
||||
@Inject()
|
||||
userSuiteService: UserSuiteService;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { CertInfo, EVENT_CERT_APPLY_SUCCESS } from "@certd/plugin-cert";
|
||||
import { PipelineEvent } from "@certd/pipeline";
|
||||
|
||||
@Autoload()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class AutoEPipelineEmitterRegister {
|
||||
@Inject()
|
||||
certInfoService: CertInfoService;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Application } from '@midwayjs/koa';
|
||||
import { httpsServer, HttpsServerOptions } from './https/server.js';
|
||||
|
||||
@Autoload()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class AutoZPrint {
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ICaptchaAddon } from "../../../plugins/plugin-captcha/api.js";
|
||||
import { AddonGetterService } from "../../pipeline/service/addon-getter-service.js";
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class CaptchaService {
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { EmailService } from './email-service.js';
|
||||
/**
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class CodeService {
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
@@ -30,7 +30,7 @@ export type EmailConfig = {
|
||||
usePlus?: boolean;
|
||||
} & SendMailOptions;
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class EmailService implements IEmailService {
|
||||
@Inject()
|
||||
settingsService: UserSettingsService;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { merge } from 'lodash-es';
|
||||
import { GroupEntity } from '../entity/group.js';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class GroupService extends BaseService<GroupEntity> {
|
||||
@InjectEntityModel(GroupEntity)
|
||||
repository: Repository<GroupEntity>;
|
||||
|
||||
@@ -15,7 +15,7 @@ import { CnameRecordEntity } from "../../cname/entity/cname-record.js";
|
||||
*
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, {allowDowngrade: true})
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class DomainService extends BaseService<DomainEntity> {
|
||||
@InjectEntityModel(DomainEntity)
|
||||
repository: Repository<DomainEntity>;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { CommonProviders } from './common-provider.js';
|
||||
* 授权
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class CnameProviderService extends BaseService<CnameProviderEntity> {
|
||||
@InjectEntityModel(CnameProviderEntity)
|
||||
repository: Repository<CnameProviderEntity>;
|
||||
|
||||
@@ -37,7 +37,7 @@ type CnameCheckCacheValue = {
|
||||
* 授权
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class CnameRecordService extends BaseService<CnameRecordEntity> {
|
||||
@InjectEntityModel(CnameRecordEntity)
|
||||
repository: Repository<CnameRecordEntity>;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { SqlAdapter } from './d.js';
|
||||
import { MysqlAdapter } from './mysql.js';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class DbAdapter implements SqlAdapter {
|
||||
adapter: SqlAdapter;
|
||||
@Config('typeorm.dataSource.default.type')
|
||||
|
||||
@@ -22,7 +22,7 @@ import { OauthBoundService } from "./oauth-bound-service.js";
|
||||
/**
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, {allowDowngrade: true})
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class LoginService {
|
||||
@Inject()
|
||||
userService: UserService;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { OauthBoundEntity } from "../entity/oauth-bound.js";
|
||||
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class OauthBoundService extends BaseService<OauthBoundEntity> {
|
||||
|
||||
@InjectEntityModel(OauthBoundEntity)
|
||||
|
||||
@@ -7,7 +7,7 @@ import { UserService } from "../../sys/authority/service/user-service.js";
|
||||
* 授权
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class TwoFactorService {
|
||||
@Inject()
|
||||
userSettingsService: UserSettingsService;
|
||||
|
||||
@@ -14,7 +14,7 @@ const UserSettingCache = new LocalCache({
|
||||
* 授权
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class UserSettingsService extends BaseService<UserSettingsEntity> {
|
||||
@InjectEntityModel(UserSettingsEntity)
|
||||
repository: Repository<UserSettingsEntity>;
|
||||
|
||||
@@ -12,7 +12,7 @@ import { DomainVerifierGetter } from "../../pipeline/service/getter/domain-verif
|
||||
|
||||
|
||||
@Provide("CertInfoFacade")
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class CertInfoFacade {
|
||||
|
||||
@Inject()
|
||||
|
||||
@@ -16,7 +16,7 @@ export type UploadCertReq = {
|
||||
|
||||
|
||||
@Provide("CertInfoService")
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class CertInfoService extends BaseService<CertInfoEntity> {
|
||||
@InjectEntityModel(CertInfoEntity)
|
||||
repository: Repository<CertInfoEntity>;
|
||||
|
||||
@@ -18,7 +18,7 @@ import {Cron} from "../../cron/cron.js";
|
||||
import { dnsContainer } from "./dns-custom.js";
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, {allowDowngrade: true})
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class SiteInfoService extends BaseService<SiteInfoEntity> {
|
||||
@InjectEntityModel(SiteInfoEntity)
|
||||
repository: Repository<SiteInfoEntity>;
|
||||
|
||||
@@ -18,7 +18,7 @@ import { dnsContainer } from "./dns-custom.js";
|
||||
const dns = dnsSdk.promises;
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class SiteIpService extends BaseService<SiteIpEntity> {
|
||||
@InjectEntityModel(SiteIpEntity)
|
||||
repository: Repository<SiteIpEntity>;
|
||||
|
||||
@@ -15,7 +15,7 @@ export type OpenKey = {
|
||||
scope: string;
|
||||
};
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class OpenKeyService extends BaseService<OpenKeyEntity> {
|
||||
@InjectEntityModel(OpenKeyEntity)
|
||||
repository: Repository<OpenKeyEntity>;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { AddonService, newAddon, PermissionException, ValidateException } from "
|
||||
* Addon
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class AddonGetterService {
|
||||
|
||||
@Inject()
|
||||
|
||||
@@ -3,7 +3,7 @@ import { pluginGroups, pluginRegistry } from '@certd/pipeline';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class BuiltInPluginService {
|
||||
getList() {
|
||||
const collection = pluginRegistry.storage;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
import { SiteInfo ,ISiteInfoGetter} from "@certd/plugin-lib";
|
||||
|
||||
@Provide("siteInfoGetter")
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class SiteInfoGetter implements ISiteInfoGetter{
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
@@ -70,7 +70,7 @@ export class TaskServiceGetter implements IServiceGetter{
|
||||
}
|
||||
}
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class TaskServiceBuilder {
|
||||
@ApplicationContext()
|
||||
appCtx: IMidwayContainer;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { HistoryLogEntity } from '../entity/history-log.js';
|
||||
* 证书申请
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class HistoryLogService extends BaseService<HistoryLogEntity> {
|
||||
@InjectEntityModel(HistoryLogEntity)
|
||||
repository: Repository<HistoryLogEntity>;
|
||||
|
||||
@@ -16,7 +16,7 @@ import { logger } from '@certd/basic';
|
||||
* 证书申请
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class HistoryService extends BaseService<HistoryEntity> {
|
||||
@InjectEntityModel(HistoryEntity)
|
||||
repository: Repository<HistoryEntity>;
|
||||
|
||||
@@ -16,7 +16,7 @@ import { EmailService } from '../../basic/service/email-service.js';
|
||||
import { isComm, isPlus } from '@certd/plus-core';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class NotificationService extends BaseService<NotificationEntity> {
|
||||
@InjectEntityModel(NotificationEntity)
|
||||
repository: Repository<NotificationEntity>;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { PipelineGroupEntity } from '../entity/pipeline-group.js';
|
||||
import { merge } from 'lodash-es';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class PipelineGroupService extends BaseService<PipelineGroupEntity> {
|
||||
@InjectEntityModel(PipelineGroupEntity)
|
||||
repository: Repository<PipelineGroupEntity>;
|
||||
|
||||
@@ -56,7 +56,7 @@ const runningTasks: Map<string | number, Executor> = new Map();
|
||||
* 证书申请
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class PipelineService extends BaseService<PipelineEntity> {
|
||||
@InjectEntityModel(PipelineEntity)
|
||||
repository: Repository<PipelineEntity>;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { StorageEntity } from '../entity/storage.js';
|
||||
/**
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class StorageService extends BaseService<StorageEntity> {
|
||||
@InjectEntityModel(StorageEntity)
|
||||
repository: Repository<StorageEntity>;
|
||||
|
||||
@@ -6,7 +6,7 @@ import {SubDomainEntity} from '../entity/sub-domain.js';
|
||||
import {EmailService} from '../../basic/service/email-service.js';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class SubDomainService extends BaseService<SubDomainEntity> {
|
||||
@InjectEntityModel(SubDomainEntity)
|
||||
repository: Repository<SubDomainEntity>;
|
||||
|
||||
@@ -9,7 +9,7 @@ import {PipelineEntity} from "../entity/pipeline.js";
|
||||
import {Pipeline} from "@certd/pipeline";
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, {allowDowngrade: true})
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class TemplateService extends BaseService<TemplateEntity> {
|
||||
@InjectEntityModel(TemplateEntity)
|
||||
repository: Repository<TemplateEntity>;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import { SysInstallInfo, SysSettingsService } from '@certd/lib-server';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class UrlService implements IUrlService {
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { IPluginConfigService, PluginConfig } from '@certd/pipeline';
|
||||
import { PluginConfigService } from './plugin-config-service.js';
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class PluginConfigGetter implements IPluginConfigService {
|
||||
@Inject()
|
||||
pluginConfigService: PluginConfigService;
|
||||
|
||||
@@ -22,7 +22,7 @@ export type PluginFindReq = {
|
||||
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class PluginConfigService {
|
||||
@Inject()
|
||||
pluginService: PluginService;
|
||||
|
||||
@@ -20,7 +20,7 @@ export type PluginImportReq = {
|
||||
};
|
||||
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, {allowDowngrade: true})
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class PluginService extends BaseService<PluginEntity> {
|
||||
@InjectEntityModel(PluginEntity)
|
||||
repository: Repository<PluginEntity>;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { IUsedCountService } from '@certd/commercial-core';
|
||||
import { SiteInfoService } from '../../monitor/service/site-info-service.js';
|
||||
|
||||
@Provide('myCountService')
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class MyCountService implements IUsedCountService {
|
||||
@Inject()
|
||||
pipelineService: PipelineService;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { RoleService } from './role-service.js';
|
||||
* 权限校验
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class AuthService {
|
||||
@Inject()
|
||||
roleService: RoleService;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { PermissionEntity } from '../entity/permission.js';
|
||||
* 权限资源
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class PermissionService extends BaseService<PermissionEntity> {
|
||||
@InjectEntityModel(PermissionEntity)
|
||||
repository: Repository<PermissionEntity>;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { RolePermissionEntity } from '../entity/role-permission.js';
|
||||
* 角色->权限
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class RolePermissionService extends BaseService<RolePermissionEntity> {
|
||||
@InjectEntityModel(RolePermissionEntity)
|
||||
repository: Repository<RolePermissionEntity>;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { LRUCache } from 'lru-cache';
|
||||
* 角色
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class RoleService extends BaseService<RoleEntity> {
|
||||
@InjectEntityModel(RoleEntity)
|
||||
repository: Repository<RoleEntity>;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { UserRoleEntity } from '../entity/user-role.js';
|
||||
* 用户->角色
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class UserRoleService extends BaseService<UserRoleEntity> {
|
||||
@InjectEntityModel(UserRoleEntity)
|
||||
repository: Repository<UserRoleEntity>;
|
||||
|
||||
@@ -23,7 +23,7 @@ export const AdminRoleId = 1
|
||||
* 系统用户
|
||||
*/
|
||||
@Provide()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class UserService extends BaseService<UserEntity> {
|
||||
|
||||
@InjectEntityModel(UserEntity)
|
||||
|
||||
@@ -12,7 +12,7 @@ export type NetTestResult = {
|
||||
}
|
||||
|
||||
@Provide('nettestService')
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class NetTestService {
|
||||
/**
|
||||
* 执行Telnet测试
|
||||
|
||||
@@ -47,7 +47,7 @@ export const hiddenStatus = new HiddenStatus();
|
||||
|
||||
|
||||
@Provide('safeService')
|
||||
@Scope(ScopeEnum.Request, {allowDowngrade: true})
|
||||
@Scope(ScopeEnum.Singleton, { allowDowngrade: true })
|
||||
export class SafeService {
|
||||
|
||||
@Inject()
|
||||
|
||||
Reference in New Issue
Block a user