添加nms另外两个接口,只写了controller和bean,service和dao还没有写,先供劲松测试

This commit is contained in:
RenKaiGe-Office
2018-09-27 19:07:27 +08:00
parent 861b962199
commit efeadc3f39
5 changed files with 375 additions and 1 deletions

View File

@@ -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;
}
}

View File

@@ -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<NmsDiRule> nmsDiRuleList;
public List<NmsDiRule> getNmsDiRuleList() {
return nmsDiRuleList;
}
public void setNmsDiRuleList(List<NmsDiRule> nmsDiRuleList) {
this.nmsDiRuleList = nmsDiRuleList;
}
}

View File

@@ -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;
}
}

View File

@@ -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<TrafficNetflowPortInfo> trafficNetflowPortInfoList;
public List<TrafficNetflowPortInfo> getTrafficNetflowPortInfoList() {
return trafficNetflowPortInfoList;
}
public void setTrafficNetflowPortInfoList(List<TrafficNetflowPortInfo> trafficNetflowPortInfoList) {
this.trafficNetflowPortInfoList = trafficNetflowPortInfoList;
}
}

View File

@@ -11,7 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; 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.domain.restful.TrafficNmsServerStatisticList;
import com.nis.restful.RestBusinessCode; import com.nis.restful.RestBusinessCode;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
@@ -60,4 +61,41 @@ public class NmsInfoController extends BaseRestController {
Constants.IS_DEBUG ? trafficNmsServerStatisticList : null); 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<String, Object> 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<String, Object> 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);
}
} }