添加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

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