chat robot 调试修改 消息响应修改为一秒一条
This commit is contained in:
@@ -9,7 +9,6 @@ import com.ai.da.service.ChatRobotService;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||||
@@ -72,7 +71,10 @@ public class ChatRobotServiceImpl implements ChatRobotService {
|
|||||||
String line;
|
String line;
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
log.info(line);
|
log.info(line);
|
||||||
|
|
||||||
emitter.send(line);
|
emitter.send(line);
|
||||||
|
Thread.sleep(1000);
|
||||||
|
|
||||||
}
|
}
|
||||||
reader.close();
|
reader.close();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -41,26 +41,6 @@
|
|||||||
"type": "java.lang.String",
|
"type": "java.lang.String",
|
||||||
"sourceType": "com.ai.da.common.config.FileProperties"
|
"sourceType": "com.ai.da.common.config.FileProperties"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "file.linux.path",
|
|
||||||
"type": "java.lang.String",
|
|
||||||
"sourceType": "com.ai.da.common.config.FileProperties$ElPath"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "file.mac.path",
|
|
||||||
"type": "java.lang.String",
|
|
||||||
"sourceType": "com.ai.da.common.config.FileProperties$ElPath"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "file.sys.path",
|
|
||||||
"type": "java.lang.String",
|
|
||||||
"sourceType": "com.ai.da.common.config.FileProperties$ElPath"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "file.windows.path",
|
|
||||||
"type": "java.lang.String",
|
|
||||||
"sourceType": "com.ai.da.common.config.FileProperties$ElPath"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "spring.security.auth-api",
|
"name": "spring.security.auth-api",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.String",
|
||||||
|
|||||||
Reference in New Issue
Block a user