| | |
| | | package com.iailab.module.data.channel.http.controller.admin; |
| | | |
| | | import com.iailab.framework.apilog.core.annotation.ApiAccessLog; |
| | | import com.iailab.framework.common.exception.enums.GlobalErrorCodeConstants; |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageParam; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.Parameters; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import static com.iailab.framework.apilog.core.enums.OperateTypeEnum.EXPORT; |
| | | import static com.iailab.framework.common.pojo.CommonResult.error; |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | |
| | |
| | | PageResult<HttpTagEntity> page = tagService.queryPage(reqVO); |
| | | PageResult<HttpTagRespVO> pageResult = BeanUtils.toBean(page, HttpTagRespVO.class); |
| | | try { |
| | | pageResult.getList().forEach(item -> { |
| | | /*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); |
| | | } |
| | | |
| | | @PostMapping("/tag-value") |
| | | public CommonResult<HttpTagRespVO> getTagValue(@RequestBody HttpTagRespVO reqVO) { |
| | | HttpTagRespVO result = new HttpTagRespVO(); |
| | | if (StringUtils.isBlank(reqVO.getTagName())) { |
| | | return CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST); |
| | | } |
| | | if (StringUtils.isBlank(reqVO.getApiId())) { |
| | | return CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST); |
| | | } |
| | | result.setDataValue(httpCollector.getTagValue(reqVO.getApiId(), reqVO.getTagName())); |
| | | result.setDataTime(new Date()); |
| | | result.setDataQuality(DataQualityEnum.getEumByValue(reqVO.getDataValue()).getDesc()); |
| | | return success(result); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermission('data:channel-http:query')") |
| | | @GetMapping("list") |
| | | public CommonResult<List<HttpTagEntity>> list(){ |