...
|
...
|
@@ -55,7 +55,7 @@ public class HostInfoCtrl { |
|
|
@RequestMapping("/getHostInfoJsonWithAuth")
|
|
|
@ResponseBody
|
|
|
public String getHostInfoJsonWithAuth(@RequestBody CmdbApiReq apiReq) {
|
|
|
log.debug("cmdbapi param {}", apiReq);
|
|
|
|
|
|
return hostInfoService.getHostInfoJsonWithAuth(apiReq.getSignature(),apiReq.getAppid(),apiReq.getTimestamp(),apiReq.getLol(),apiReq.getContent());
|
|
|
}
|
|
|
|
...
|
...
|
@@ -63,7 +63,6 @@ public class HostInfoCtrl { |
|
|
@ResponseBody
|
|
|
public BaseResponse<PageResponse<HostInfo>> getHostInfos(@RequestBody HostInfoReq req) throws Exception {
|
|
|
|
|
|
log.info("getHostInfos with param is {}", req);
|
|
|
if(StringUtils.isNotBlank(req.getHostIp())){
|
|
|
String[] arrayIps=req.getHostIp().split(",");
|
|
|
if(arrayIps.length>1){
|
...
|
...
|
@@ -82,14 +81,14 @@ public class HostInfoCtrl { |
|
|
response.setRows(responseBO.getRows());
|
|
|
response.setPageSize(responseBO.getPageSize());
|
|
|
response.setTotal(responseBO.getTotal());
|
|
|
log.info("getHostInfos success and total={}", response.getTotal());
|
|
|
|
|
|
return new BaseResponse<PageResponse<HostInfo>>(response);
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/saveHostInfo")
|
|
|
@ResponseBody
|
|
|
public BaseResponse<Integer> saveHostInfo(@RequestBody HostInfo req) throws Exception {
|
|
|
log.info("saveMechineInfo with param is {}", req);
|
|
|
|
|
|
return hostInfoService.saveHostInfo(req);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -97,21 +96,21 @@ public class HostInfoCtrl { |
|
|
@RequestMapping("/delHostInfo")
|
|
|
@ResponseBody
|
|
|
public BaseResponse<Integer> delHostInfo(@RequestParam(value = "id", required = true) Integer id ) throws Exception {
|
|
|
log.info("delMechineInfo with param is {}", id);
|
|
|
|
|
|
return hostInfoService.delHostInfoById(id);
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/getHostInfoById")
|
|
|
@ResponseBody
|
|
|
public BaseResponse<HostInfo> getHostInfoById(int id) throws Exception {
|
|
|
log.info("getHostInfoById with param is {}", id);
|
|
|
|
|
|
return hostInfoService.getHostInfoById(id);
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/getHostInfoByIP")
|
|
|
@ResponseBody
|
|
|
public BaseResponse<HostInfo> getHostInfoByIp(String ip) throws Exception {
|
|
|
log.info("getHostInfoByIp with param is {}", ip);
|
|
|
|
|
|
HostInfo hostInfo= hostInfoService.getHostInfoByHostIp(ip);
|
|
|
BaseResponse<HostInfo> resp=new BaseResponse<HostInfo>();
|
|
|
if(hostInfo!=null){
|
...
|
...
|
@@ -126,7 +125,7 @@ public class HostInfoCtrl { |
|
|
@ResponseBody
|
|
|
public BaseResponse<List<HostInfo>> getHostInfoByIps( @RequestBody String ips) throws Exception {
|
|
|
List<String> hostIps = JSON.parseArray(ips,String.class);
|
|
|
log.info("getHostInfoByIps with param is {}", ips);
|
|
|
|
|
|
List<HostInfo> hostInfos = hostInfoService.getHostInfoByIps(hostIps);
|
|
|
BaseResponse<List<HostInfo>> response = new BaseResponse<List<HostInfo>>(hostInfos);
|
|
|
return response;
|
...
|
...
|
@@ -161,7 +160,7 @@ public class HostInfoCtrl { |
|
|
@ResponseBody
|
|
|
public BaseResponse removeHostInfoByIps(@RequestBody List<String> removeIps){
|
|
|
// List<HostInfo> hostInfoList = JSON.parseArray(hosts,HostInfo.class);
|
|
|
log.info("removeHostInfoByIps with param is {}", removeIps);
|
|
|
|
|
|
return hostInfoService.removeByIps(removeIps);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -169,7 +168,7 @@ public class HostInfoCtrl { |
|
|
@ResponseBody
|
|
|
public BaseResponse saveHostListInfos(@RequestBody List<HostInfo> hostInfos ){
|
|
|
// List<HostInfo> hostInfos = JSON.parseArray(hosts,HostInfo.class);
|
|
|
log.info("saveHostListInfos with param is {}", hostInfos);
|
|
|
|
|
|
return hostInfoService.saveHostListInfo(hostInfos);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -196,7 +195,6 @@ public class HostInfoCtrl { |
|
|
public BaseResponse<Integer> saveHostTags(@RequestBody SetHostTagsReq req) {
|
|
|
String hostIds = req.getHostIds();
|
|
|
String tags = req.getTags();
|
|
|
log.info("saveHostTags with param is {}, {}", hostIds, tags);
|
|
|
List<Integer> hostIdList = JSON.parseArray(hostIds,Integer.class);
|
|
|
|
|
|
return hostInfoService.saveHostTags(hostIdList,tags);
|
...
|
...
|
|