From fd0a9f56983ffae049b17afc38dc030d05265d99 Mon Sep 17 00:00:00 2001 From: Yeseo Date: Sun, 17 Mar 2024 23:37:55 +0900 Subject: [PATCH] feat: Add SummarizationController (#7) --- .../post/SummarizationController.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main/java/com/beotkkot/qtudy/controller/post/SummarizationController.java diff --git a/src/main/java/com/beotkkot/qtudy/controller/post/SummarizationController.java b/src/main/java/com/beotkkot/qtudy/controller/post/SummarizationController.java new file mode 100644 index 0000000..e0b17fc --- /dev/null +++ b/src/main/java/com/beotkkot/qtudy/controller/post/SummarizationController.java @@ -0,0 +1,28 @@ +package com.beotkkot.qtudy.controller.post; + +import com.beotkkot.qtudy.dto.response.posts.GetSummaryResponseDto; +import com.beotkkot.qtudy.service.posts.PostsService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@Slf4j +@RestController +@RequiredArgsConstructor +public class SummarizationController { + + private final PostsService postsService; + + /** + * 사용자가 작성한 글에 대해 AI가 요약한 내용을 반환한다. + */ + @GetMapping("summary/{postId}") + public ResponseEntity summary(@PathVariable("postId") Long postId) { + // 포스트 아이디로부터 포스트 얻어오기 + ResponseEntity response = postsService.getSummary(postId); + return response; + } +}