|
|
package com.ui.ctrl;
|
|
|
|
|
|
import com.ui.contants.HttpUriContants;
|
|
|
import com.ui.http.HttpRestClient;
|
|
|
import com.ui.model.BaseResponse;
|
|
|
import com.ui.model.MonitAlarmInfo;
|
|
|
import com.ui.model.req.ZkDetailReq;
|
|
|
import com.ui.model.req.ZkTreeReq;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* @author yoho
|
|
|
* 对外提供接口
|
|
|
*
|
|
|
*/
|
|
|
@Controller
|
|
|
@RequestMapping("/outer")
|
|
|
public class OuterIntfCtrl {
|
|
|
|
|
|
Logger log = LoggerFactory.getLogger(OuterIntfCtrl.class);
|
|
|
|
|
|
@Autowired
|
|
|
private HttpRestClient httpClient;
|
|
|
|
|
|
/**
|
|
|
* 对外接口,提供报警
|
|
|
* @param info
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("/recvMonitAlarm")
|
|
|
@ResponseBody
|
|
|
public BaseResponse recvMonitAlarm(@RequestBody MonitAlarmInfo info){
|
|
|
BaseResponse response=httpClient.defaultPost("recvMonitAlarm",info,BaseResponse.class);
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 对外接口,提供报警
|
|
|
* @param info
|
|
|
* @param mobiles
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("/recvMonitAlarmInfo")
|
|
|
@ResponseBody
|
|
|
public BaseResponse recvMonitAlarmInfo(String info,String mobiles){
|
|
|
Map<String,String> map=new HashMap<>();
|
|
|
map.put("info",info);
|
|
|
map.put("mobiles",mobiles);
|
|
|
BaseResponse response=httpClient.defaultGet("recvMonitAlarmInfo",BaseResponse.class,map);;
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 捕获的恶意ip写入运维系统的redis
|
|
|
* 自动封杀和告警提示
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("/writeMipsObjToOpsReids")
|
|
|
@ResponseBody
|
|
|
public void writeMipsObjToOpsReids(@RequestBody String ipsObjs) {
|
|
|
//httpClient..defaultPost()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 捕获的恶意ip写入运维系统的mysql
|
|
|
* 大数据算法
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("/writeMipsInfoToOpsDb")
|
|
|
@ResponseBody
|
|
|
public void writeMipsInfoToOpsDb(@RequestBody String ipsObjs) {
|
|
|
ipImpl.writeMipsInfoToOpsDb(ipsObjs);
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|