Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/main/java/com/team4/giftidea/controller/GptController.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
Expand All @@ -22,6 +25,7 @@
/**
* GPT API와 연동하여 선물 추천을 제공하는 컨트롤러
*/
@Tag(name = "GPT 추천 API", description = "GPT를 이용하여 사용자 맞춤 선물 추천을 제공하는 API")
@RestController
@RequestMapping("/api/gpt")
@Slf4j
Expand All @@ -46,8 +50,13 @@ public GptController(RestTemplate restTemplate, GptConfig gptConfig, ProductServ
* @param theme 선물의 주제 (ex: 'birthday', 'valentine', etc.)
* @return 추천된 상품 목록
*/
@PostMapping("/process")
@Operation(description = "카카오톡 대화를 분석하여 키워드를 추출하고 그에 맞는 선물 목록을 추천합니다.")
@Operation(summary = "대화 분석 후 추천 상품 반환", description = "카카오톡 대화를 분석하여 GPT API를 통해 키워드를 추출하고, 해당 키워드에 맞는 추천 상품을 반환합니다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "추천 상품 목록 반환"),
@ApiResponse(responseCode = "400", description = "잘못된 요청 파라미터"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류 발생")
})
@PostMapping("/process")
public List<Product> processFileAndRecommend(
@RequestParam("file") @Parameter(description = "카카오톡 대화 내용이 포함된 파일", required = true) MultipartFile file,
@RequestParam("targetName") @Parameter(description = "대상 이름", required = true) String targetName,
Expand Down