parent
b5af576c31
commit
07295dbf37
@ -1,29 +0,0 @@
|
||||
package com.ruoyi.screen.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.screen.domain.ZongzhiSourceResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 太仓综治大屏接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/zongzhi/screen")
|
||||
@Api(tags = " 太仓综治大屏接口")
|
||||
public class ZongzhiScreenController {
|
||||
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
@ApiOperation(value = "数据来源", response = ZongzhiSourceResponse.class)
|
||||
@GetMapping("/source")
|
||||
private AjaxResult getSource(){
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.ruoyi.screen.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.screen.domain.response.*;
|
||||
import com.ruoyi.screen.service.ZongzhiScreenSaftyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 太仓综治网络安全大屏接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/zongzhi/saftyscreen")
|
||||
@Api(tags = " 太仓综治网络安全大屏接口")
|
||||
public class ZongzhiScreenSaftyController {
|
||||
@Autowired
|
||||
private ZongzhiScreenSaftyService zongzhiScreenSaftyService;
|
||||
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
@ApiOperation(value = "数据来源", response = ZongzhiSourceResponse.class)
|
||||
@GetMapping("/source")
|
||||
private AjaxResult getSource() {
|
||||
|
||||
return AjaxResult.success(zongzhiScreenSaftyService.getSource());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 安全检测数据统计
|
||||
*/
|
||||
@ApiOperation(value = "安全检测数据统计", response = ZongzhiSafetyCountResponse.class)
|
||||
@GetMapping("/safety")
|
||||
private AjaxResult getSafety() {
|
||||
ZongzhiSafetyCountResponse zongzhiSafetyCountResponse = new ZongzhiSafetyCountResponse();
|
||||
List<ZongzhiSafetyResponse> getSafetyList = zongzhiScreenSaftyService.getsafety();
|
||||
//求和
|
||||
int sum = getSafetyList.stream().mapToInt(ZongzhiSafetyResponse::getCount).sum();
|
||||
zongzhiSafetyCountResponse.setList(getSafetyList);
|
||||
zongzhiSafetyCountResponse.setSum(sum);
|
||||
return AjaxResult.success(zongzhiSafetyCountResponse);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 安全检测数据列表
|
||||
*/
|
||||
@ApiOperation(value = "安全检测数据列表", response = ZongzhiSafetyListResponse.class)
|
||||
@GetMapping("/safetylist")
|
||||
private AjaxResult getSafetyList() {
|
||||
return AjaxResult.success(zongzhiScreenSaftyService.getSafetyList());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 安全检测监管对象
|
||||
*/
|
||||
@ApiOperation(value = "安全检测监管对象", response = ZongzhiSuperviseResponse.class)
|
||||
@GetMapping("/supervise")
|
||||
private AjaxResult getSupervise() {
|
||||
return AjaxResult.success(zongzhiScreenSaftyService.getsupervise());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 各地区攻击次数
|
||||
*/
|
||||
@ApiOperation(value = "各地区攻击次数", response = ZongzhiAttackResponse.class)
|
||||
@GetMapping("/attack")
|
||||
private AjaxResult getAttack() {
|
||||
return AjaxResult.success(zongzhiScreenSaftyService.getAttack());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 受攻击情况Top5及分布情况
|
||||
*/
|
||||
@ApiOperation(value = "受攻击情况Top5及分布情况", response = ZongzhiUnAttackResponse.class)
|
||||
@GetMapping("/unattack")
|
||||
private AjaxResult getUnAttackTop() {
|
||||
return AjaxResult.success(zongzhiScreenSaftyService.getUnAttackTop());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 安全隐患
|
||||
*/
|
||||
@ApiOperation(value = "安全隐患", response = ZongzhiSafetyHazardResponse.class)
|
||||
@GetMapping("/safetyhazard")
|
||||
private AjaxResult getSafetyHazard() {
|
||||
return AjaxResult.success(zongzhiScreenSaftyService.getSafetyHazard());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package com.ruoyi.screen.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 大屏数据来源响应类
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("大屏数据来源响应类")
|
||||
public class ZongzhiSourceResponse {
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.ruoyi.screen.domain.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 大屏数据各地区攻击次数响应类
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("大屏数据各地区攻击次数响应类")
|
||||
public class ZongzhiAttackResponse {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer count;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "攻击源IP地址区域")
|
||||
private String attackIpRegion;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.ruoyi.screen.domain.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 大屏数据安全监测数据响应类
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("大屏数据安全监测数据响应类")
|
||||
public class ZongzhiSafetyCountResponse {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "总数")
|
||||
private int sum;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "大屏数据安全监测响应类")
|
||||
private List<ZongzhiSafetyResponse> list ;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.ruoyi.screen.domain.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 安全隐患响应类
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("安全隐患响应类")
|
||||
public class ZongzhiSafetyHazardResponse {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer count;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "攻击源IP地址区域")
|
||||
private String attackIpRegion;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ruoyi.screen.domain.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 安全检测监管对象响应类
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("安全检测监管对象响应类")
|
||||
public class ZongzhiSuperviseResponse {
|
||||
|
||||
/**
|
||||
* 等保系统名称
|
||||
*/
|
||||
@ApiModelProperty(value = "等保系统名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 等保系统数量
|
||||
*/
|
||||
@ApiModelProperty(value = "等保系统数量")
|
||||
private int count;
|
||||
|
||||
|
||||
/**
|
||||
* 等保单位名称
|
||||
*/
|
||||
@ApiModelProperty(value = "等保单位名称")
|
||||
private String name1;
|
||||
|
||||
/**
|
||||
* 等保单位数量
|
||||
*/
|
||||
@ApiModelProperty(value = "等保单位数量")
|
||||
private int count1;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 政府网站名称
|
||||
*/
|
||||
@ApiModelProperty(value = "政府网站名称")
|
||||
private String name2;
|
||||
|
||||
/**
|
||||
* 政府网站数量
|
||||
*/
|
||||
@ApiModelProperty(value = "政府网站数量")
|
||||
private int count2;
|
||||
|
||||
|
||||
/**
|
||||
* IDC单位名称
|
||||
*/
|
||||
@ApiModelProperty(value = "IDC单位名称")
|
||||
private String name3;
|
||||
|
||||
/**
|
||||
* IDC单位数量
|
||||
*/
|
||||
@ApiModelProperty(value = "IDC单位数量")
|
||||
private int count3;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.screen.domain.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 受攻击情况Top5及分布情况响应类
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("受攻击情况Top5及分布情况响应类")
|
||||
public class ZongzhiUnAttackResponse {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer count;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "百分比")
|
||||
private Integer pt;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "攻击源IP地址区域")
|
||||
private String attackIpRegion;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "攻击源IP")
|
||||
private String attackedIp;
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.ruoyi.screen.mapper;
|
||||
|
||||
import com.ruoyi.screen.domain.response.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 大屏网络安全数据层
|
||||
*/
|
||||
public interface ZongzhiScreenSaftyMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 查询来源数据
|
||||
*
|
||||
* @return ZongzhiSourceResponse
|
||||
*/
|
||||
public List<ZongzhiSourceResponse> getSource();
|
||||
|
||||
|
||||
/**
|
||||
* 安全检测数据统计
|
||||
*/
|
||||
public List<ZongzhiSafetyResponse> getsafety();
|
||||
|
||||
|
||||
/**
|
||||
* 安全检测数据列表
|
||||
*/
|
||||
public List<ZongzhiSafetyListResponse> getSafetyList();
|
||||
|
||||
|
||||
/**
|
||||
* 安全检测监管对象
|
||||
*/
|
||||
public ZongzhiSuperviseResponse getsupervise();
|
||||
|
||||
|
||||
/**
|
||||
* 各地区攻击次数
|
||||
*/
|
||||
public List<ZongzhiAttackResponse> getAttack();
|
||||
|
||||
|
||||
/**
|
||||
* 受攻击情况Top5及分布情况
|
||||
*/
|
||||
public List<ZongzhiUnAttackResponse> getUnAttackTop();
|
||||
|
||||
|
||||
/**
|
||||
* 安全隐患
|
||||
*/
|
||||
public List<ZongzhiSafetyHazardResponse> getSafetyHazard();
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.ruoyi.screen.service;
|
||||
|
||||
import com.ruoyi.screen.domain.response.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 大屏网络安全业务层
|
||||
*/
|
||||
public interface ZongzhiScreenSaftyService {
|
||||
|
||||
/**
|
||||
* 查询来源数据
|
||||
*/
|
||||
public List<ZongzhiSourceResponse> getSource();
|
||||
|
||||
|
||||
/**
|
||||
* 安全检测数据统计
|
||||
*/
|
||||
public List<ZongzhiSafetyResponse> getsafety();
|
||||
|
||||
|
||||
/**
|
||||
* 安全检测数据列表
|
||||
*/
|
||||
public List<ZongzhiSafetyListResponse> getSafetyList();
|
||||
|
||||
|
||||
/**
|
||||
* 安全检测监管对象
|
||||
*/
|
||||
public ZongzhiSuperviseResponse getsupervise();
|
||||
|
||||
|
||||
/**
|
||||
* 各地区攻击次数
|
||||
*/
|
||||
public List<ZongzhiAttackResponse> getAttack();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 受攻击情况Top5及分布情况
|
||||
*/
|
||||
public List<ZongzhiUnAttackResponse> getUnAttackTop();
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 安全隐患
|
||||
*/
|
||||
public List<ZongzhiSafetyHazardResponse> getSafetyHazard();
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.ruoyi.screen.service.impl;
|
||||
|
||||
import com.ruoyi.screen.domain.response.*;
|
||||
import com.ruoyi.screen.mapper.ZongzhiScreenSaftyMapper;
|
||||
import com.ruoyi.screen.service.ZongzhiScreenSaftyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 大屏网络安全实现层
|
||||
*/
|
||||
@Service
|
||||
public class ZongzhiScreenSaftyServiceImpl implements ZongzhiScreenSaftyService {
|
||||
@Autowired
|
||||
private ZongzhiScreenSaftyMapper zongzhiScreenSaftyMapper;
|
||||
@Override
|
||||
public List<ZongzhiSourceResponse> getSource() {
|
||||
return zongzhiScreenSaftyMapper.getSource();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZongzhiSafetyResponse> getsafety() {
|
||||
return zongzhiScreenSaftyMapper.getsafety();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZongzhiSafetyListResponse> getSafetyList() {
|
||||
return zongzhiScreenSaftyMapper.getSafetyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZongzhiSuperviseResponse getsupervise() {
|
||||
return zongzhiScreenSaftyMapper.getsupervise();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZongzhiAttackResponse> getAttack() {
|
||||
return zongzhiScreenSaftyMapper.getAttack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZongzhiUnAttackResponse> getUnAttackTop() {
|
||||
return zongzhiScreenSaftyMapper.getUnAttackTop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZongzhiSafetyHazardResponse> getSafetyHazard() {
|
||||
return zongzhiScreenSaftyMapper.getSafetyHazard();
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.screen.mapper.ZongzhiScreenSaftyMapper">
|
||||
|
||||
|
||||
<select id="getSource" resultType="com.ruoyi.screen.domain.response.ZongzhiSourceResponse">
|
||||
select count(*) as count ,type
|
||||
from tc_data_source
|
||||
GROUP BY type
|
||||
</select>
|
||||
<select id="getsafety" resultType="com.ruoyi.screen.domain.response.ZongzhiSafetyResponse">
|
||||
select count(*) as count ,attack_type AS attackType
|
||||
from tc_safety_detection
|
||||
GROUP BY attack_type
|
||||
</select>
|
||||
<select id="getSafetyList" resultType="com.ruoyi.screen.domain.response.ZongzhiSafetyListResponse">
|
||||
select source_ip, attack_time AS attackTime , attack_type as attackType
|
||||
from tc_safety_detection
|
||||
</select>
|
||||
<select id="getsupervise" resultType="com.ruoyi.screen.domain.response.ZongzhiSuperviseResponse">
|
||||
select a.count,
|
||||
a.name,
|
||||
b.count1,
|
||||
b.name1,
|
||||
c.count2,
|
||||
c.name2,
|
||||
d.count3,
|
||||
d.name3
|
||||
from (select count(*) as count,'等保系统' as name from tc_dengbao_system) a,
|
||||
(select count(*) as count1, '等保单位' as name1 from tc_dengbao_unit) b,
|
||||
(select count(*) as count2, '政府网站' as name2 from tc_government_web) c,
|
||||
(select count(*) as count3, 'IDC单位' as name3 from tc_idc_unit) d
|
||||
|
||||
</select>
|
||||
<select id="getAttack" resultType="com.ruoyi.screen.domain.response.ZongzhiAttackResponse">
|
||||
SELECT COUNT(*) AS count, attack_ip_region as attackIpRegion
|
||||
FROM tc_safety_detection
|
||||
GROUP BY attack_ip_region;
|
||||
</select>
|
||||
<select id="getUnAttackTop" resultType="com.ruoyi.screen.domain.response.ZongzhiUnAttackResponse">
|
||||
select attacked_ip as attackedIp, attacked_ip_region as attackIpRegion, count(*)as count, ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 1) AS pt
|
||||
from tc_safety_detection
|
||||
GROUP BY attacked_ip
|
||||
ORDER BY count desc limit 5
|
||||
</select>
|
||||
<select id="getSafetyHazard" resultType="com.ruoyi.screen.domain.response.ZongzhiSafetyHazardResponse">
|
||||
select type,count(*) as count from tc_safety_danger GROUP BY type
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in new issue