From 3913ab75a9775a7304755d8fef07840d49a3c101 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 5 Jul 2024 17:10:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=96=E9=83=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=9B=91=E6=B5=8B=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/ExternalInterfaceMonitoringTask.java | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/task/ExternalInterfaceMonitoringTask.java b/zc-business/src/main/java/com/zc/business/task/ExternalInterfaceMonitoringTask.java index 1746bba4..6251b3a8 100644 --- a/zc-business/src/main/java/com/zc/business/task/ExternalInterfaceMonitoringTask.java +++ b/zc-business/src/main/java/com/zc/business/task/ExternalInterfaceMonitoringTask.java @@ -5,8 +5,11 @@ import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.fasterxml.jackson.databind.ObjectMapper; +import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.system.service.ISysConfigService; @@ -20,9 +23,14 @@ import com.zc.business.service.impl.DcTrafficStatisticsServiceImpl; import com.zc.common.core.httpclient.OkHttp; import com.zc.common.core.httpclient.exception.HttpException; import com.zc.common.core.httpclient.request.RequestParams; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import okhttp3.*; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.io.IOException; @@ -30,16 +38,16 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; +import java.util.*; /** * 外部接口监控 */ +@Api(tags = "外部接口监控") +@RestController @Component -public class ExternalInterfaceMonitoringTask { +@RequestMapping("/externalInterface") +public class ExternalInterfaceMonitoringTask extends BaseController { // 视频平台token private static String videoTOKEN; @@ -58,6 +66,28 @@ public class ExternalInterfaceMonitoringTask { @Resource private ISysConfigService configService; + /** + * 外部接口监控信息列表 + */ + @ApiOperation("外部接口监控信息列表") + @GetMapping("/list") + public TableDataInfo list(ExternalInterfaceMonitoring externalInterfaceMonitoring) + { + startPage(); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + if (externalInterfaceMonitoring.getInterfaceOwnership() != null) { + lambdaQueryWrapper.eq(ExternalInterfaceMonitoring::getInterfaceOwnership, externalInterfaceMonitoring.getInterfaceOwnership()); + } + if (externalInterfaceMonitoring.getOperationStatus() != null) { + lambdaQueryWrapper.eq(ExternalInterfaceMonitoring::getOperationStatus, externalInterfaceMonitoring.getOperationStatus()); + } + if (externalInterfaceMonitoring.getInterfaceName() != null) { + lambdaQueryWrapper.like(ExternalInterfaceMonitoring::getInterfaceName, externalInterfaceMonitoring.getInterfaceName()); + } + List list = externalInterfaceMonitoringMapper.selectList(lambdaQueryWrapper); + return getDataTable(list); + } + @Scheduled(cron = "0 0/15 * * * ?") public void externalInterfaceDataMonitoring() throws Exception {