|
|
|
@ -3,23 +3,25 @@ package com.inspect.bigmodel.service.impl; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.inspect.base.core.utils.HttpClientUtils; |
|
|
|
import com.inspect.bigmodel.service.IBigModelResultService; |
|
|
|
import com.inspect.task.service.IPatrolTaskService; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class BigModelResultServiceImpl implements IBigModelResultService { |
|
|
|
private final Logger log = LoggerFactory.getLogger(BigModelResultServiceImpl.class); |
|
|
|
@Value("${bigModel.record.url:http://192.168.110.119:8007}") |
|
|
|
private String bigModelRecordUrl; |
|
|
|
@Autowired |
|
|
|
private IPatrolTaskService patrolTaskService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONObject getBigModelResult() { |
|
|
|
log.info("-----调用大模型结果接口地址,url:{}", bigModelRecordUrl + "/bigModel/record/latest"); |
|
|
|
String analyseFilter = patrolTaskService.selectConfigByKey("ANALYSE_IS_FILTER"); |
|
|
|
log.info("-----调用大模型结果接口地址,url:{}", analyseFilter + "/bigModel/record/latest"); |
|
|
|
String resultStr; |
|
|
|
try { |
|
|
|
resultStr = HttpClientUtils.get(bigModelRecordUrl + "/bigModel/record/latest", ""); |
|
|
|
resultStr = HttpClientUtils.get(analyseFilter + "/bigModel/record/latest", ""); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("调用大模型结果接口,返回数据异常,exception:{}", e.getMessage()); |
|
|
|
throw new RuntimeException(e); |
|
|
|
|