package com.bjtds.brichat.controller; import com.bjtds.brichat.entity.dto.KnowledgeBaseDto; import com.bjtds.brichat.entity.dto.RecordDto; import com.bjtds.brichat.service.KnowledgeBaseService; import com.bjtds.brichat.util.ResultUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @Api(tags = "知识库检索接口") @RestController @RequestMapping("/knowledge-base") public class KnowledgeBaseController { @Autowired private KnowledgeBaseService knowledgeBaseService; @ApiOperation("返回检索数据") @PostMapping("/retrieval") public ResultUtils retrieval(@RequestBody KnowledgeBaseDto knowledgeBaseDto) throws Exception{ List retrievalResult = knowledgeBaseService.retrieval(knowledgeBaseDto); return ResultUtils.success(retrievalResult); } }