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.
fu-hsi-service/src/main/java/com/supervision/chat/controller/TestController.java

35 lines
1.0 KiB
Java

9 months ago
package com.supervision.chat.controller;
import cn.hutool.json.JSONUtil;
import com.supervision.chat.client.LangChainChatService;
import com.supervision.chat.client.dto.CreateBaseDTO;
import com.supervision.chat.client.dto.LangChainChatRes;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.service.annotation.PostExchange;
import java.util.concurrent.Executors;
@Slf4j
@RequestMapping("chat/test/")
@RestController
@RequiredArgsConstructor
public class TestController {
private final LangChainChatService langChainChatClient;
@GetMapping("test")
public void test(){
CreateBaseDTO createBaseDTO = new CreateBaseDTO();
createBaseDTO.setKnowledge_base_name("11111111");
langChainChatClient.chat(createBaseDTO);
// log.info(JSONUtil.toJsonStr(chat));
}
@PostMapping("testPost")
public void testPost(@RequestBody CreateBaseDTO createBaseDTO){
System.out.println(JSONUtil.toJsonStr(createBaseDTO));
}
}