Browse Source

增加外部接口监测查询接口

develop
Mr.Wang 5 months ago
parent
commit
3913ab75a9
  1. 40
      zc-business/src/main/java/com/zc/business/task/ExternalInterfaceMonitoringTask.java

40
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.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fasterxml.jackson.databind.ObjectMapper; 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.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysConfigService; 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.OkHttp;
import com.zc.common.core.httpclient.exception.HttpException; import com.zc.common.core.httpclient.exception.HttpException;
import com.zc.common.core.httpclient.request.RequestParams; import com.zc.common.core.httpclient.request.RequestParams;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import okhttp3.*; import okhttp3.*;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; 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 javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
@ -30,16 +38,16 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/** /**
* 外部接口监控 * 外部接口监控
*/ */
@Api(tags = "外部接口监控")
@RestController
@Component @Component
public class ExternalInterfaceMonitoringTask { @RequestMapping("/externalInterface")
public class ExternalInterfaceMonitoringTask extends BaseController {
// 视频平台token // 视频平台token
private static String videoTOKEN; private static String videoTOKEN;
@ -58,6 +66,28 @@ public class ExternalInterfaceMonitoringTask {
@Resource @Resource
private ISysConfigService configService; private ISysConfigService configService;
/**
* 外部接口监控信息列表
*/
@ApiOperation("外部接口监控信息列表")
@GetMapping("/list")
public TableDataInfo list(ExternalInterfaceMonitoring externalInterfaceMonitoring)
{
startPage();
LambdaQueryWrapper<ExternalInterfaceMonitoring> 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<ExternalInterfaceMonitoring> list = externalInterfaceMonitoringMapper.selectList(lambdaQueryWrapper);
return getDataTable(list);
}
@Scheduled(cron = "0 0/15 * * * ?") @Scheduled(cron = "0 0/15 * * * ?")
public void externalInterfaceDataMonitoring() throws Exception { public void externalInterfaceDataMonitoring() throws Exception {

Loading…
Cancel
Save