From 89b12276bdb1c58d0798e738f79dbd2df98f84e4 Mon Sep 17 00:00:00 2001 From: Seungil Kim Date: Thu, 5 Oct 2023 21:29:24 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Feat:=20document=20type=EC=9D=B4=20?= =?UTF-8?q?image=EC=9D=B8=20=EA=B2=BD=EC=9A=B0=20thumbnail=20url=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # --- src/document/document.service.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/document/document.service.ts b/src/document/document.service.ts index 61605d5..98ec172 100644 --- a/src/document/document.service.ts +++ b/src/document/document.service.ts @@ -14,6 +14,7 @@ import { DocumentDto } from './dto/response/document.dto'; import { OpenAiService } from '../openai/open-ai.service'; import { AwsService } from '../aws/aws.service'; import { UserService } from '../user/user.service'; +import { ConfigService } from '@nestjs/config'; @Injectable() export class DocumentService { @@ -24,6 +25,7 @@ export class DocumentService { private openAiService: OpenAiService, private awsService: AwsService, private userService: UserService, + private configService: ConfigService, ) {} async findByCursor( @@ -304,6 +306,11 @@ export class DocumentService { data: { docId, // S3 object key type: documentType, + // IMAGE 인 경우 썸네일 추가 + thumbnailUrl: + documentType === DocumentType.IMAGE + ? `${this.configService.get('THUMBNAIL_URL')}/${docId}` + : null, status: Status.EMBED_PENDING, user: { connect: { id: user.id } }, title: file.originalname,