...
|
...
|
@@ -6,8 +6,6 @@ import com.monitor.cmdb.service.IHostInfoService; |
|
|
import com.monitor.model.request.HostInfoReq;
|
|
|
import com.monitor.model.response.BaseResponse;
|
|
|
import com.monitor.model.response.PageResponse;
|
|
|
import com.monitor.mysql.mapper.HostInfoMapper;
|
|
|
import org.codehaus.jackson.map.Serializers;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
...
|
...
|
@@ -19,15 +17,10 @@ import org.springframework.web.bind.annotation.RequestParam; |
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
import javax.xml.ws.Response;
|
|
|
import java.util.HashSet;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
import java.util.concurrent.ExecutionException;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.concurrent.TimeoutException;
|
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -43,8 +36,6 @@ public class HostInfoCtrl { |
|
|
@Autowired
|
|
|
IHostInfoService hostInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/getHostInfos")
|
|
|
@ResponseBody
|
|
|
public BaseResponse<PageResponse<HostInfo>> getHostInfos(@RequestBody HostInfoReq req) throws Exception {
|
...
|
...
|
@@ -130,30 +121,5 @@ public class HostInfoCtrl { |
|
|
return JSON.toJSONString(ips);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 更新主机tag信息为空
|
|
|
* @param ips
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("/updateHostInfoByIps")
|
|
|
@ResponseBody
|
|
|
public BaseResponse updateHostInfoByIps(String ips){
|
|
|
List<HostInfo> hostInfoList = JSON.parseArray(ips,HostInfo.class);
|
|
|
try{
|
|
|
hostInfoService.updateTagByIps(hostInfoList);
|
|
|
return new BaseResponse();
|
|
|
}catch(Exception e){
|
|
|
log.error("updateHostInfoByIps error",e);
|
|
|
return new BaseResponse("updateHostInfoByIps error");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/saveHostListInfos")
|
|
|
@ResponseBody
|
|
|
public BaseResponse saveHostListInfos(String hosts){
|
|
|
List<HostInfo> hostInfos = JSON.parseArray(hosts,HostInfo.class);
|
|
|
return hostInfoService.saveHostListInfo(hostInfos);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
|