返回 AiToEarn
account.module.ts
根目录 / project / aitoearn-electron / server / src / modules / account / account.module.ts
1 import { Global, Module } from '@nestjs/common';
2 import { MongooseModule } from '@nestjs/mongoose';
3 import { Account, AccountSchema } from '../../db/schema/account.schema';
4 import { AccountService } from './account.service';
5 import { AccountController } from './account.controller';
6 import { AccountGroupController } from './accountGroup/accountGroup.controller';
7 import { AccountGroupService } from './accountGroup/accountGroup.service';
8 import {
9 AccountGroup,
10 AccountGroupSchema,
11 } from '../../db/schema/accountGroup.schema';
12
13 @Global()
14 @Module({
15 imports: [
16 MongooseModule.forFeature([{ name: Account.name, schema: AccountSchema }]),
17 MongooseModule.forFeature([
18 { name: AccountGroup.name, schema: AccountGroupSchema },
19 ]),
20 ],
21 providers: [AccountService, AccountGroupService],
22 controllers: [AccountController, AccountGroupController],
23 exports: [AccountService, AccountGroupService],
24 })
25 export class AccountModule {}
26
26 lines TYPESCRIPT