diff --git a/src/modules/posts/posts.service.ts b/src/modules/posts/posts.service.ts index c289ceb..24db3ff 100644 --- a/src/modules/posts/posts.service.ts +++ b/src/modules/posts/posts.service.ts @@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common'; import { CreatePostDto } from '@src/modules/posts/dto/create-post.dto'; import { PostsRepository } from '@src/modules/posts/posts.repository'; import { AwsLambdaService } from '@src/infrastructure/aws-lambda/aws-lambda.service'; +import { parseLinkTitleAndContent } from '@src/common'; @Injectable() export class PostsService { @@ -13,13 +14,13 @@ export class PostsService { createPostDto: CreatePostDto, userId: string, ): Promise { - // TODO get title from url - const title: string = 'temp title'; - - // TODO lambda function name + const { title, content } = await parseLinkTitleAndContent( + createPostDto.url, + ); + // TODO ai 요청용 람다 함수 생성 후 작업 // const ai_lambda_function_name = 'ai_lambda_function_name'; // const payload = { - // postContent: 'contents', + // postContent: content, // folderList: ['dummy_folder_list'], // }; // this.awsLambdaService.invoke_lambda(ai_lambda_function_name, payload);