返回 AiToEarn
dashscope.module.ts
根目录 / project / aitoearn-backend / apps / aitoearn-ai / src / core / ai / libs / dashscope / dashscope.module.ts
1 import { DynamicModule, Module } from '@nestjs/common'
2 import { DashscopeConfig } from './dashscope.config'
3 import { DashscopeService } from './dashscope.service'
4
5 @Module({})
6 export class DashscopeModule {
7 static forRoot(config: DashscopeConfig): DynamicModule {
8 return {
9 global: true,
10 module: DashscopeModule,
11 providers: [
12 {
13 provide: DashscopeConfig,
14 useValue: config,
15 },
16 DashscopeService,
17 ],
18 exports: [DashscopeService],
19 }
20 }
21 }
22
22 lines TYPESCRIPT