解决报错

This commit is contained in:
zren25
2025-03-06 11:00:20 +08:00
parent 7c8ce6867b
commit 1eb5162beb

View File

@@ -1,15 +1,13 @@
package com.volvo.ai.analytic.center.controller;
import com.volvo.ai.analytic.center.exception.BizException;
import com.volvo.ai.analytic.center.service.impl.DeepSeekServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.configurationprocessor.json.JSONException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
@RestController
@RequestMapping("/api/v1")
public class AiCompareController {
@@ -18,9 +16,11 @@ public class AiCompareController {
private DeepSeekServiceImpl deepSeekService;
@GetMapping("/chat1")
public String chat1(
@RequestParam(value = "source") String source,@RequestParam(value = "target") String tag
) throws IOException, JSONException {
public String chat1( @RequestParam(value = "source") String source,@RequestParam(value = "target") String tag ) {
try {
return deepSeekService.chat(source, tag);
} catch (Exception e) {
throw new BizException(e.getMessage());
}
}
}