refactor(server): use feature model (#9932)

This commit is contained in:
forehalo
2025-02-05 10:27:26 +00:00
parent 0ff8d3af6f
commit 7826e2b7c8
121 changed files with 1723 additions and 3826 deletions

View File

@@ -7,16 +7,16 @@ import { Injectable, UseGuards } from '@nestjs/common';
import { ModuleRef } from '@nestjs/core';
import { ActionForbidden, getRequestResponseFromContext } from '../../base';
import { FeatureManagementService } from '../features/management';
import { FeatureService } from '../features/service';
@Injectable()
export class AdminGuard implements CanActivate, OnModuleInit {
private feature!: FeatureManagementService;
private feature!: FeatureService;
constructor(private readonly ref: ModuleRef) {}
onModuleInit() {
this.feature = this.ref.get(FeatureManagementService, { strict: false });
this.feature = this.ref.get(FeatureService, { strict: false });
}
async canActivate(context: ExecutionContext) {