mirror of
https://github.com/immich-app/immich.git
synced 2025-11-17 12:52:38 +09:00
* 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
85 lines
2.3 KiB
TypeScript
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();
|
|
}
|
|
}
|