Files
immich/server/src/immich/app.module.ts
Jason Rasmussen 753dab8b3c feat(server): asset search endpoint (#4931)
* feat(server): GET /assets endpoint

* chore: open api

* chore: use dumb name

* feat: search by make, model, lens, city, state, country

* chore: open api

* chore: pagination validation and tests

* chore: pr feedback
2023-11-14 22:47:15 +00:00

85 lines
2.3 KiB
TypeScript

import { DomainModule } from '@app/domain';
import { InfraModule } from '@app/infra';
import { AssetEntity } from '@app/infra/entities';
import { Module, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core';
import { ScheduleModule } from '@nestjs/schedule';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AssetRepository, IAssetRepository } from './api-v1/asset/asset-repository';
import { AssetController as AssetControllerV1 } from './api-v1/asset/asset.controller';
import { AssetService } from './api-v1/asset/asset.service';
import { AppGuard } from './app.guard';
import { AppService } from './app.service';
import {
APIKeyController,
ActivityController,
AlbumController,
AppController,
AssetController,
AssetsController,
AuditController,
AuthController,
JobController,
LibraryController,
OAuthController,
PartnerController,
PersonController,
SearchController,
ServerInfoController,
SharedLinkController,
SystemConfigController,
TagController,
UserController,
} from './controllers';
import { ErrorInterceptor, FileUploadInterceptor } from './interceptors';
@Module({
imports: [
//
DomainModule.register({ imports: [InfraModule] }),
ScheduleModule.forRoot(),
TypeOrmModule.forFeature([AssetEntity]),
],
controllers: [
ActivityController,
AssetsController,
AssetController,
AssetControllerV1,
AppController,
AlbumController,
APIKeyController,
AuditController,
AuthController,
JobController,
LibraryController,
OAuthController,
PartnerController,
SearchController,
ServerInfoController,
SharedLinkController,
SystemConfigController,
TagController,
UserController,
PersonController,
],
providers: [
{ provide: APP_INTERCEPTOR, useClass: ErrorInterceptor },
{ provide: APP_GUARD, useClass: AppGuard },
{ provide: IAssetRepository, useClass: AssetRepository },
AppService,
AssetService,
FileUploadInterceptor,
],
})
export class AppModule implements OnModuleInit, OnModuleDestroy {
constructor(private appService: AppService) {}
async onModuleInit() {
await this.appService.init();
}
async onModuleDestroy() {
await this.appService.destroy();
}
}