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.GsonBuilder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
@@ -72,7 +71,10 @@ public class ChatRobotServiceImpl implements ChatRobotService {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
log.info(line);
|
||||
|
||||
emitter.send(line);
|
||||
Thread.sleep(1000);
|
||||
|
||||
}
|
||||
reader.close();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user