fix: 修复内容审核模块依赖注入问题
- 在BaseContentAdapter中添加@InjectRepository装饰器 - 在ContentModerationModule中导入JwtModule和PlatformModule - 修复Repository依赖注入问题 - 确保应用正常启动
This commit is contained in:
1251
docs/image-content-moderation-design.md
Normal file
1251
docs/image-content-moderation-design.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { HttpService } from '@nestjs/axios';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { Repository } from 'typeorm';
|
||||
@@ -19,6 +20,7 @@ export abstract class BaseContentAdapter implements IContentModerationAdapter {
|
||||
constructor(
|
||||
protected readonly httpService: HttpService,
|
||||
protected readonly configService: ConfigService,
|
||||
@InjectRepository(ContentAuditLogEntity)
|
||||
protected readonly auditLogRepository: Repository<ContentAuditLogEntity>,
|
||||
) {}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { HttpModule } from '@nestjs/axios';
|
||||
import { JwtModule } from '@nestjs/jwt';
|
||||
import { PlatformModule } from '../platform/platform.module';
|
||||
|
||||
// 实体
|
||||
import { ContentAuditLogEntity } from './entities/content-audit-log.entity';
|
||||
@@ -26,6 +28,11 @@ import { ContentAuditGuard } from './guards/content-audit.guard';
|
||||
timeout: 30000,
|
||||
maxRedirects: 3,
|
||||
}),
|
||||
JwtModule.register({
|
||||
secret: process.env.JWT_SECRET || 'default-secret',
|
||||
signOptions: { expiresIn: '1d' },
|
||||
}),
|
||||
PlatformModule,
|
||||
],
|
||||
providers: [
|
||||
// 适配器实现
|
||||
|
||||
Reference in New Issue
Block a user