|
|
|
@ -7,12 +7,15 @@ import com.supervision.chat.client.LangChainChatService;
|
|
|
|
|
import com.supervision.chat.client.dto.CreateBaseDTO;
|
|
|
|
|
import com.supervision.chat.client.dto.DeleteFileDTO;
|
|
|
|
|
import com.supervision.chat.client.dto.LangChainChatRes;
|
|
|
|
|
import com.supervision.police.domain.ModelCase;
|
|
|
|
|
import com.supervision.police.service.ModelCaseService;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RequestMapping("chat/test/")
|
|
|
|
@ -22,6 +25,8 @@ public class TestController {
|
|
|
|
|
|
|
|
|
|
private final LangChainChatService langChainChatClient;
|
|
|
|
|
|
|
|
|
|
private final ModelCaseService modelCaseService;
|
|
|
|
|
|
|
|
|
|
@GetMapping("test")
|
|
|
|
|
public void test() {
|
|
|
|
|
CreateBaseDTO createBaseDTO = new CreateBaseDTO();
|
|
|
|
@ -30,6 +35,15 @@ public class TestController {
|
|
|
|
|
log.info(JSONUtil.toJsonStr(chat));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("createExistCase")
|
|
|
|
|
public void createExistCase(){
|
|
|
|
|
List<ModelCase> list = modelCaseService.list();
|
|
|
|
|
for (ModelCase modelCase : list) {
|
|
|
|
|
LangChainChatRes chat = langChainChatClient.createBase(CreateBaseDTO.create(modelCase.getCaseNo()));
|
|
|
|
|
log.info(JSONUtil.toJsonStr(chat));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("uploadFile")
|
|
|
|
|
public void testUploadFile(@RequestPart("file") MultipartFile file) throws IOException {
|
|
|
|
|
CustomMultipartFile mockMultipartFile = new CustomMultipartFile(file.getOriginalFilename(), file.getInputStream());
|
|
|
|
|