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
@@ -12,7 +12,7 @@ import {
StorageProviderFactory,
URLHelper,
} from '../../base';
import { QuotaManagementService } from '../../core/quota';
import { QuotaService } from '../../core/quota';
@Injectable()
export class CopilotStorage {
@@ -22,7 +22,7 @@ export class CopilotStorage {
private readonly config: Config,
private readonly url: URLHelper,
private readonly storageFactory: StorageProviderFactory,
private readonly quota: QuotaManagementService
private readonly quota: QuotaService
) {
this.provider = this.storageFactory.create(
this.config.plugins.copilot.storage
@@ -57,7 +57,7 @@ export class CopilotStorage {
@CallMetric('ai', 'blob_upload')
async handleUpload(userId: string, blob: FileUpload) {
const checkExceeded = await this.quota.getQuotaCalculator(userId);
const checkExceeded = await this.quota.getUserQuotaCalculator(userId);
if (checkExceeded(0)) {
throw new BlobQuotaExceeded();