You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virtual-patient/virtual-patient-rasa/src/main/java/com/supervision/rasa/controller/Text2vecController.java

39 lines
1.3 KiB
Java

package com.supervision.rasa.controller;
import com.supervision.rasa.pojo.dto.Text2vecDataVo;
import com.supervision.rasa.pojo.dto.Text2vecMatchesReq;
import com.supervision.rasa.pojo.dto.Text2vecMatchesRes;
import com.supervision.rasa.service.Text2vecService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Tag(name = "text2vec服务")
@RestController
@RequestMapping("/text2vec")
@RequiredArgsConstructor
public class Text2vecController {
private final Text2vecService text2vecService;
@Operation(summary = "更新数据库")
@PostMapping("updateDataset")
public boolean talkRasa(@RequestBody List<Text2vecDataVo> text2vecDataVoList){
return text2vecService.updateDataset(text2vecDataVoList);
}
@Operation(summary = "获取匹配项")
@PostMapping("matches")
public List<Text2vecMatchesRes> matches(@RequestBody Text2vecMatchesReq text2vecMatchesReq){
return text2vecService.matches(text2vecMatchesReq);
}
}