解决报错
This commit is contained in:
@@ -1,15 +1,13 @@
|
|||||||
package com.volvo.ai.analytic.center.controller;
|
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 com.volvo.ai.analytic.center.service.impl.DeepSeekServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/v1")
|
@RequestMapping("/api/v1")
|
||||||
public class AiCompareController {
|
public class AiCompareController {
|
||||||
@@ -18,9 +16,11 @@ public class AiCompareController {
|
|||||||
private DeepSeekServiceImpl deepSeekService;
|
private DeepSeekServiceImpl deepSeekService;
|
||||||
|
|
||||||
@GetMapping("/chat1")
|
@GetMapping("/chat1")
|
||||||
public String chat1(
|
public String chat1( @RequestParam(value = "source") String source,@RequestParam(value = "target") String tag ) {
|
||||||
@RequestParam(value = "source") String source,@RequestParam(value = "target") String tag
|
try {
|
||||||
) throws IOException, JSONException {
|
|
||||||
return deepSeekService.chat(source, tag);
|
return deepSeekService.chat(source, tag);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BizException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user