| | |
| | | */ |
| | | |
| | | import com.iailab.framework.common.constant.CommonConstant; |
| | | import com.iailab.module.data.channel.http.collector.asdb.HttpCollectorForAsdb; |
| | | import com.iailab.module.data.channel.http.collector.ihdb.HttpCollectorForIhd; |
| | | import com.iailab.module.data.channel.http.entity.HttpApiEntity; |
| | | import com.iailab.module.data.channel.http.service.HttpApiService; |
| | |
| | | @Autowired |
| | | private HttpCollectorForIhd httpCollectorForIhd; |
| | | |
| | | @Autowired |
| | | private HttpCollectorForAsdb httpCollectorForAsdb; |
| | | |
| | | public Object getTagValue(String apiId, String tag) { |
| | | HttpApiEntity httpApi = httpApiService.getFromCatch(apiId); |
| | | if (httpApi == null) { |
| | |
| | | Map<String, Object> valueMap = new HashMap<String, Object>(); |
| | | if (SourceApiEnum.iHyperDB.getCode().equals(httpApi.getCode())) { |
| | | valueMap = httpCollectorForIhd.getLastValues(apiId, tagNames); |
| | | } else if (SourceApiEnum.ASDB.getCode().equals(httpApi.getCode())) { |
| | | valueMap = httpCollectorForAsdb.getTagValues(apiId, tagNames); |
| | | } |
| | | if (valueMap.get(tag) == null) { |
| | | return CommonConstant.BAD_VALUE; |