Commit 64582e53 authored by alex yao's avatar alex yao

fix[智能问数]: 修复[数据库查询异常]断连问题

parent cf7758b9
......@@ -33,16 +33,21 @@ public class ChainServiceImpl implements ChainService {
@Override
public DBChainResult dbChain(DBChainResponse response) {
logger.info("dbChain response : {}", response);
DBChainResult dbChainResult = aiDialogueService.dbChain(response);
if (dbChainResult == null || dbChainResult.getStatus().equals("error")) {
logger.error("dbChain result error : {} , response:{}", dbChainResult, response);
try {
DBChainResult dbChainResult = aiDialogueService.dbChain(response);
if (dbChainResult == null || dbChainResult.getStatus().equals("error")) {
logger.error("dbChain result error : {} , response:{}", dbChainResult, response);
return null;
}
if (StringUtils.isBlank(dbChainResult.getSqlResult())) {
logger.warn("dbChain result sqlResult is blank : {} , response:{}", dbChainResult, response);
return null;
}
return dbChainResult;
} catch (Exception e) {
logger.error("调用数据库失败:{}", e.getMessage());
return null;
}
if (StringUtils.isBlank(dbChainResult.getSqlResult())) {
logger.warn("dbChain result sqlResult is blank : {} , response:{}", dbChainResult, response);
return null;
}
return dbChainResult;
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment