add content service and core config

This commit is contained in:
2025-05-12 15:26:49 +08:00
parent 9ac2fd8f44
commit 57c72e010b
4 changed files with 105 additions and 42 deletions
@@ -0,0 +1,31 @@
import { Global, Injectable, Module } from '@nestjs/common';
import { get } from 'lodash';
import { AppController } from '@/app.controller';
import { AppService } from '@/app.service';
import { ContentModule } from '@/modules/content/content.module';
const config: Record<string, any> = {
name: 'ray',
};
@Injectable()
export class ConfigService {
get<T>(key: string, defaultValue?: T): T | undefined {
return get(config, key, defaultValue);
}
}
@Global()
@Module({
providers: [ConfigService],
exports: [ConfigService],
})
export class CoreModule {}
@Module({
imports: [ContentModule, CoreModule],
providers: [AppService],
controllers: [AppController],
})
export class AppModule {}