| | |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.concurrent.ArrayBlockingQueue; |
| | | import java.util.concurrent.ThreadPoolExecutor; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import static com.iailab.framework.apilog.core.enums.OperateTypeEnum.EXPORT; |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | |
| | | @Resource |
| | | private HttpCollector httpCollector; |
| | | |
| | | ThreadPoolExecutor threadPool = new ThreadPoolExecutor(18, 36, 30, TimeUnit.SECONDS, |
| | | new ArrayBlockingQueue<Runnable>(36), new ThreadPoolExecutor.AbortPolicy()); |
| | | |
| | | @PreAuthorize("@ss.hasPermission('data:channel-http:query')") |
| | | @GetMapping("page") |
| | | public CommonResult<PageResult<HttpTagRespVO>> page(@Valid HttpTagPageReqVO reqVO) { |
| | | PageResult<HttpTagEntity> page = tagService.queryPage(reqVO); |
| | | PageResult<HttpTagRespVO> pageResult = BeanUtils.toBean(page, HttpTagRespVO.class); |
| | | try { |
| | | pageResult.getList().forEach(item -> { |
| | | item.setDataValue(httpCollector.getTagValue(item.getApiId(), item.getTagName())); |
| | | item.setDataTime(new Date()); |
| | | item.setDataQuality(DataQualityEnum.getEumByValue(item.getDataValue()).getDesc()); |
| | | }); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | return success(pageResult); |
| | | } |
| | | |