From efeadc3f39a18a93d7709749e6cd33ae2a51c95b Mon Sep 17 00:00:00 2001 From: RenKaiGe-Office Date: Thu, 27 Sep 2018 19:07:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0nms=E5=8F=A6=E5=A4=96?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E6=8E=A5=E5=8F=A3,=E5=8F=AA=E5=86=99?= =?UTF-8?q?=E4=BA=86controller=E5=92=8Cbean,service=E5=92=8Cdao=E8=BF=98?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=86=99,=E5=85=88=E4=BE=9B=E5=8A=B2?= =?UTF-8?q?=E6=9D=BE=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nis/domain/restful/NmsDiRule.java | 190 ++++++++++++++++++ .../com/nis/domain/restful/NmsDiRuleList.java | 19 ++ .../restful/TrafficNetflowPortInfo.java | 108 ++++++++++ .../restful/TrafficNetflowPortInfoList.java | 19 ++ .../controller/restful/NmsInfoController.java | 40 +++- 5 files changed, 375 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/nis/domain/restful/NmsDiRule.java create mode 100644 src/main/java/com/nis/domain/restful/NmsDiRuleList.java create mode 100644 src/main/java/com/nis/domain/restful/TrafficNetflowPortInfo.java create mode 100644 src/main/java/com/nis/domain/restful/TrafficNetflowPortInfoList.java diff --git a/src/main/java/com/nis/domain/restful/NmsDiRule.java b/src/main/java/com/nis/domain/restful/NmsDiRule.java new file mode 100644 index 0000000..4882051 --- /dev/null +++ b/src/main/java/com/nis/domain/restful/NmsDiRule.java @@ -0,0 +1,190 @@ +package com.nis.domain.restful; + +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.wordnik.swagger.annotations.ApiModelProperty; + +public class NmsDiRule implements Serializable { + + private static final long serialVersionUID = 1L; + @JsonIgnore + private long id; + private long detectionInfoId; + private long serviceIndex; + private long serviceCode; + private String serviceDesc; + private long agedTime; + private String clientNum; + private String refluxPort; + private String ruleNumber; + private String usedRuleNum; + private String leftRuleNum; + private String hitTotalNum; + private String detectionedState; + private long seqId; + private long detectionSetInfoId; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "dataCheckTime", notes = "") + private Date dataCheckTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "dataArriveTime", notes = "") + private Date dataArriveTime; + private long dataCheckTimeDigital; + private long dataArriveTimeDigital; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public long getDetectionInfoId() { + return detectionInfoId; + } + + public void setDetectionInfoId(long detectionInfoId) { + this.detectionInfoId = detectionInfoId; + } + + public long getServiceIndex() { + return serviceIndex; + } + + public void setServiceIndex(long serviceIndex) { + this.serviceIndex = serviceIndex; + } + + public long getServiceCode() { + return serviceCode; + } + + public void setServiceCode(long serviceCode) { + this.serviceCode = serviceCode; + } + + public String getServiceDesc() { + return serviceDesc; + } + + public void setServiceDesc(String serviceDesc) { + this.serviceDesc = serviceDesc; + } + + public long getAgedTime() { + return agedTime; + } + + public void setAgedTime(long agedTime) { + this.agedTime = agedTime; + } + + public String getClientNum() { + return clientNum; + } + + public void setClientNum(String clientNum) { + this.clientNum = clientNum; + } + + public String getRefluxPort() { + return refluxPort; + } + + public void setRefluxPort(String refluxPort) { + this.refluxPort = refluxPort; + } + + public String getRuleNumber() { + return ruleNumber; + } + + public void setRuleNumber(String ruleNumber) { + this.ruleNumber = ruleNumber; + } + + public String getUsedRuleNum() { + return usedRuleNum; + } + + public void setUsedRuleNum(String usedRuleNum) { + this.usedRuleNum = usedRuleNum; + } + + public String getLeftRuleNum() { + return leftRuleNum; + } + + public void setLeftRuleNum(String leftRuleNum) { + this.leftRuleNum = leftRuleNum; + } + + public String getHitTotalNum() { + return hitTotalNum; + } + + public void setHitTotalNum(String hitTotalNum) { + this.hitTotalNum = hitTotalNum; + } + + public String getDetectionedState() { + return detectionedState; + } + + public void setDetectionedState(String detectionedState) { + this.detectionedState = detectionedState; + } + + public long getSeqId() { + return seqId; + } + + public void setSeqId(long seqId) { + this.seqId = seqId; + } + + public long getDetectionSetInfoId() { + return detectionSetInfoId; + } + + public void setDetectionSetInfoId(long detectionSetInfoId) { + this.detectionSetInfoId = detectionSetInfoId; + } + + public Date getDataCheckTime() { + return dataCheckTime; + } + + public void setDataCheckTime(Date dataCheckTime) { + this.dataCheckTime = dataCheckTime; + } + + public Date getDataArriveTime() { + return dataArriveTime; + } + + public void setDataArriveTime(Date dataArriveTime) { + this.dataArriveTime = dataArriveTime; + } + + public long getDataCheckTimeDigital() { + return dataCheckTimeDigital; + } + + public void setDataCheckTimeDigital(long dataCheckTimeDigital) { + this.dataCheckTimeDigital = dataCheckTimeDigital; + } + + public long getDataArriveTimeDigital() { + return dataArriveTimeDigital; + } + + public void setDataArriveTimeDigital(long dataArriveTimeDigital) { + this.dataArriveTimeDigital = dataArriveTimeDigital; + } + +} diff --git a/src/main/java/com/nis/domain/restful/NmsDiRuleList.java b/src/main/java/com/nis/domain/restful/NmsDiRuleList.java new file mode 100644 index 0000000..3f2c7a7 --- /dev/null +++ b/src/main/java/com/nis/domain/restful/NmsDiRuleList.java @@ -0,0 +1,19 @@ +package com.nis.domain.restful; + +import java.io.Serializable; +import java.util.List; + +public class NmsDiRuleList implements Serializable { + + private static final long serialVersionUID = 1L; + private List nmsDiRuleList; + + public List getNmsDiRuleList() { + return nmsDiRuleList; + } + + public void setNmsDiRuleList(List nmsDiRuleList) { + this.nmsDiRuleList = nmsDiRuleList; + } + +} diff --git a/src/main/java/com/nis/domain/restful/TrafficNetflowPortInfo.java b/src/main/java/com/nis/domain/restful/TrafficNetflowPortInfo.java new file mode 100644 index 0000000..d78dc32 --- /dev/null +++ b/src/main/java/com/nis/domain/restful/TrafficNetflowPortInfo.java @@ -0,0 +1,108 @@ +package com.nis.domain.restful; + +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.wordnik.swagger.annotations.ApiModelProperty; + +public class TrafficNetflowPortInfo implements Serializable { + + private static final long serialVersionUID = 1L; + @JsonIgnore + private long stat_id; + private long port; + private String nodeName; + private String nodeIp; + private String portDesc; + private long bandwidth; + private long inoctets; + private long outoctets; + private long inoctetsSpeed; + private long outoctetsSpeed; + private long inpktsSpeed; + private long outpktsSpeed; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "dataArriveTime", notes = "") + private Date recvTime; + public long getStat_id() { + return stat_id; + } + public void setStat_id(long stat_id) { + this.stat_id = stat_id; + } + public long getPort() { + return port; + } + public void setPort(long port) { + this.port = port; + } + public String getNodeName() { + return nodeName; + } + public void setNodeName(String nodeName) { + this.nodeName = nodeName; + } + public String getNodeIp() { + return nodeIp; + } + public void setNodeIp(String nodeIp) { + this.nodeIp = nodeIp; + } + public String getPortDesc() { + return portDesc; + } + public void setPortDesc(String portDesc) { + this.portDesc = portDesc; + } + public long getBandwidth() { + return bandwidth; + } + public void setBandwidth(long bandwidth) { + this.bandwidth = bandwidth; + } + public long getInoctets() { + return inoctets; + } + public void setInoctets(long inoctets) { + this.inoctets = inoctets; + } + public long getOutoctets() { + return outoctets; + } + public void setOutoctets(long outoctets) { + this.outoctets = outoctets; + } + public long getInoctetsSpeed() { + return inoctetsSpeed; + } + public void setInoctetsSpeed(long inoctetsSpeed) { + this.inoctetsSpeed = inoctetsSpeed; + } + public long getOutoctetsSpeed() { + return outoctetsSpeed; + } + public void setOutoctetsSpeed(long outoctetsSpeed) { + this.outoctetsSpeed = outoctetsSpeed; + } + public long getInpktsSpeed() { + return inpktsSpeed; + } + public void setInpktsSpeed(long inpktsSpeed) { + this.inpktsSpeed = inpktsSpeed; + } + public long getOutpktsSpeed() { + return outpktsSpeed; + } + public void setOutpktsSpeed(long outpktsSpeed) { + this.outpktsSpeed = outpktsSpeed; + } + public Date getRecvTime() { + return recvTime; + } + public void setRecvTime(Date recvTime) { + this.recvTime = recvTime; + } + +} diff --git a/src/main/java/com/nis/domain/restful/TrafficNetflowPortInfoList.java b/src/main/java/com/nis/domain/restful/TrafficNetflowPortInfoList.java new file mode 100644 index 0000000..f10ac22 --- /dev/null +++ b/src/main/java/com/nis/domain/restful/TrafficNetflowPortInfoList.java @@ -0,0 +1,19 @@ +package com.nis.domain.restful; + +import java.io.Serializable; +import java.util.List; + +public class TrafficNetflowPortInfoList implements Serializable { + + private static final long serialVersionUID = 1L; + private List trafficNetflowPortInfoList; + + public List getTrafficNetflowPortInfoList() { + return trafficNetflowPortInfoList; + } + + public void setTrafficNetflowPortInfoList(List trafficNetflowPortInfoList) { + this.trafficNetflowPortInfoList = trafficNetflowPortInfoList; + } + +} diff --git a/src/main/java/com/nis/web/controller/restful/NmsInfoController.java b/src/main/java/com/nis/web/controller/restful/NmsInfoController.java index 7523cef..8a7cc7c 100644 --- a/src/main/java/com/nis/web/controller/restful/NmsInfoController.java +++ b/src/main/java/com/nis/web/controller/restful/NmsInfoController.java @@ -11,7 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import com.nis.domain.restful.TrafficNmsServerStatistic; +import com.nis.domain.restful.NmsDiRuleList; +import com.nis.domain.restful.TrafficNetflowPortInfoList; import com.nis.domain.restful.TrafficNmsServerStatisticList; import com.nis.restful.RestBusinessCode; import com.nis.restful.RestServiceException; @@ -60,4 +61,41 @@ public class NmsInfoController extends BaseRestController { Constants.IS_DEBUG ? trafficNmsServerStatisticList : null); } + @RequestMapping(value = "/nms/v1/saveNmsDiRule", method = RequestMethod.POST) + @ApiOperation(value = "存储NmsDiRule接口", httpMethod = "POST", response = Map.class, notes = "接收NMS系统上报的di信息") + @ApiParam(value = "存储NmsDiRule接口", name = "saveServerStatus", required = true) + public Map saveNmsDiRule(@RequestBody NmsDiRuleList nmsDiRuleList, HttpServletRequest request, + HttpServletResponse response) { + long start = System.currentTimeMillis(); + AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, + nmsDiRuleList); + try { + + } catch (Exception e) { + throw new RestServiceException(thread, System.currentTimeMillis() - start, + "上报NmsDiRule信息异常:" + e.getMessage(), RestBusinessCode.unknow_error.getValue()); + } + return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "上报NmsDiRule信息成功", + Constants.IS_DEBUG ? nmsDiRuleList : null); + } + + @RequestMapping(value = "/nms/v1/rafficNetflowPortInfo", method = RequestMethod.POST) + @ApiOperation(value = "存储trafficNetflowPortInfo接口", httpMethod = "POST", response = Map.class, notes = "接收NMS系统上报的trafficNetflowPort信息") + @ApiParam(value = "存储trafficNetflowPortInfo接口", name = "saveTrafficNetflowPortInfo", required = true) + public Map saveTrafficNetflowPortInfo( + @RequestBody TrafficNetflowPortInfoList trafficNetflowPortInfoList, HttpServletRequest request, + HttpServletResponse response) { + long start = System.currentTimeMillis(); + AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, + trafficNetflowPortInfoList); + try { + + } catch (Exception e) { + throw new RestServiceException(thread, System.currentTimeMillis() - start, + "上报trafficNetflowPort信息异常:" + e.getMessage(), RestBusinessCode.unknow_error.getValue()); + } + return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, + "上报trafficNetflowPort信息成功", Constants.IS_DEBUG ? trafficNetflowPortInfoList : null); + } + }