mirror of
https://github.com/immich-app/immich.git
synced 2025-11-30 21:29:44 +09:00
refactor(server): logger (#9472)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Body, Controller, Get, Next, Param, Post, Put, Query, Res } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Inject, Next, Param, Post, Put, Query, Res } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { NextFunction, Response } from 'express';
|
||||
import { BulkIdResponseDto } from 'src/dtos/asset-ids.response.dto';
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
PersonStatisticsResponseDto,
|
||||
PersonUpdateDto,
|
||||
} from 'src/dtos/person.dto';
|
||||
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||||
import { Auth, Authenticated, FileResponse } from 'src/middleware/auth.guard';
|
||||
import { PersonService } from 'src/services/person.service';
|
||||
import { sendFile } from 'src/utils/file';
|
||||
@@ -23,7 +24,10 @@ import { UUIDParamDto } from 'src/validation';
|
||||
@ApiTags('Person')
|
||||
@Controller('person')
|
||||
export class PersonController {
|
||||
constructor(private service: PersonService) {}
|
||||
constructor(
|
||||
private service: PersonService,
|
||||
@Inject(ILoggerRepository) private logger: ILoggerRepository,
|
||||
) {}
|
||||
|
||||
@Get()
|
||||
@Authenticated()
|
||||
@@ -74,7 +78,7 @@ export class PersonController {
|
||||
@Auth() auth: AuthDto,
|
||||
@Param() { id }: UUIDParamDto,
|
||||
) {
|
||||
await sendFile(res, next, () => this.service.getThumbnail(auth, id));
|
||||
await sendFile(res, next, () => this.service.getThumbnail(auth, id), this.logger);
|
||||
}
|
||||
|
||||
@Get(':id/assets')
|
||||
|
||||
Reference in New Issue
Block a user