package com.supervision.controller;

import com.supervision.dto.matchTool.MatchQuestionAnswerDTO;
import com.supervision.service.MatchToolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "相似度匹配工具")
@RestController
@RequestMapping("matchTool")
@RequiredArgsConstructor
public class MatchToolController {

    private final MatchToolService matchToolService;

    @ApiOperation("刷新匹配工具知识库")
    @GetMapping("refreshMatchToolLibrary")
    public void refreshMatchToolLibrary() {
        matchToolService.refreshMatchToolLibrary();
    }

    @ApiOperation("进行问答")
    @GetMapping("execMatch")
    public List<MatchQuestionAnswerDTO> execMatch(String question) {
        return matchToolService.execMatch(question);
    }
}
