|
@@ -1,33 +1,23 @@
|
|
|
-package com.goafanti.baiduAI.controller;
|
|
|
|
|
|
|
+package com.goafanti.ChatAI.controller;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
-import com.goafanti.baiduAI.bo.*;
|
|
|
|
|
-import com.goafanti.baiduAI.service.BaiduAiService;
|
|
|
|
|
-import com.goafanti.common.bo.Result;
|
|
|
|
|
|
|
+import com.goafanti.ChatAI.bo.*;
|
|
|
|
|
+import com.goafanti.ChatAI.service.ChatAiService;
|
|
|
import com.goafanti.common.bo.SseEmitterUTF8;
|
|
import com.goafanti.common.bo.SseEmitterUTF8;
|
|
|
-import com.goafanti.common.constant.ErrorConstants;
|
|
|
|
|
-import com.goafanti.common.controller.BaseController;
|
|
|
|
|
-import com.goafanti.common.controller.CertifyApiController;
|
|
|
|
|
-import com.goafanti.common.error.BusinessException;
|
|
|
|
|
-import com.goafanti.common.model.AftUser;
|
|
|
|
|
-import com.goafanti.common.utils.IpUtils;
|
|
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
|
-import com.goafanti.common.utils.StringUtils;
|
|
|
|
|
-import com.goafanti.core.shiro.token.TokenManager;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
|
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping(value = "/chat")
|
|
@RequestMapping(value = "/chat")
|
|
|
-public class BaiduAiController {
|
|
|
|
|
|
|
+public class ChatAiController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- private BaiduAiService baiduAiService;
|
|
|
|
|
|
|
+ private ChatAiService chatAiService;
|
|
|
|
|
|
|
|
@RequestMapping(value = "/send")
|
|
@RequestMapping(value = "/send")
|
|
|
public Object sendChat(@RequestBody InputSendChat in){
|
|
public Object sendChat(@RequestBody InputSendChat in){
|
|
@@ -35,12 +25,12 @@ public class BaiduAiController {
|
|
|
in.setUserId(UUID.randomUUID().toString());
|
|
in.setUserId(UUID.randomUUID().toString());
|
|
|
in.setStream(true);
|
|
in.setStream(true);
|
|
|
}
|
|
}
|
|
|
- return baiduAiService.sendChat(in);
|
|
|
|
|
|
|
+ return chatAiService.sendChat(in);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "/sendGLM")
|
|
@RequestMapping(value = "/sendGLM")
|
|
|
public Object sendGLM(@RequestBody InputsendGLM in){
|
|
public Object sendGLM(@RequestBody InputsendGLM in){
|
|
|
- return baiduAiService.sendGLM(in);
|
|
|
|
|
|
|
+ return chatAiService.sendGLM(in);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|