mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): logger (#9472)
This commit is contained in:
parent
b1ca5455b5
commit
46868b3336
7 changed files with 46 additions and 43 deletions
|
|
@ -5,6 +5,7 @@ import {
|
|||
Get,
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
Inject,
|
||||
Next,
|
||||
Param,
|
||||
Post,
|
||||
|
|
@ -19,6 +20,7 @@ import { NextFunction, Response } from 'express';
|
|||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
import { CreateProfileImageDto, CreateProfileImageResponseDto } from 'src/dtos/user-profile.dto';
|
||||
import { CreateUserDto, DeleteUserDto, UpdateUserDto, UserResponseDto } from 'src/dtos/user.dto';
|
||||
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||||
import { Auth, Authenticated, FileResponse } from 'src/middleware/auth.guard';
|
||||
import { FileUploadInterceptor, Route } from 'src/middleware/file-upload.interceptor';
|
||||
import { UserService } from 'src/services/user.service';
|
||||
|
|
@ -28,7 +30,10 @@ import { UUIDParamDto } from 'src/validation';
|
|||
@ApiTags('User')
|
||||
@Controller(Route.USER)
|
||||
export class UserController {
|
||||
constructor(private service: UserService) {}
|
||||
constructor(
|
||||
private service: UserService,
|
||||
@Inject(ILoggerRepository) private logger: ILoggerRepository,
|
||||
) {}
|
||||
|
||||
@Get()
|
||||
@Authenticated()
|
||||
|
|
@ -100,6 +105,6 @@ export class UserController {
|
|||
@FileResponse()
|
||||
@Authenticated()
|
||||
async getProfileImage(@Res() res: Response, @Next() next: NextFunction, @Param() { id }: UUIDParamDto) {
|
||||
await sendFile(res, next, () => this.service.getProfileImage(id));
|
||||
await sendFile(res, next, () => this.service.getProfileImage(id), this.logger);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue