...
|
...
|
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.deser.Deserializers; |
|
|
import com.model.HostGroup;
|
|
|
import com.model.HostInfo;
|
|
|
import com.model.MObjectInfo;
|
|
|
import com.model.TypeInfo;
|
|
|
import com.monitor.cmdb.service.IHostGroupService;
|
|
|
import com.monitor.cmdb.service.IHostInfoService;
|
|
|
import com.monitor.cmdb.service.IMObjectInfoService;
|
...
|
...
|
@@ -419,4 +420,53 @@ public class MObjectInfoCtrl { |
|
|
return true;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取所有java app服务
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/javaapi")
|
|
|
@ResponseBody
|
|
|
public BaseResponse queryJavaApiMobject() {
|
|
|
|
|
|
List<TypeInfo> allTypeInfo = null;
|
|
|
|
|
|
BaseResponse response = new BaseResponse();
|
|
|
|
|
|
try {
|
|
|
TypeInfo typeInfo = typeInfoService.queryTypeInfoByName(TypeInfoCtrl.TYPE_JAVA_APP);
|
|
|
|
|
|
|
|
|
if (typeInfo == null) {
|
|
|
return response;
|
|
|
}
|
|
|
allTypeInfo = typeInfoService.queryChildTypesInfo(typeInfo.getTypeId());
|
|
|
|
|
|
if (null == allTypeInfo) {
|
|
|
return response;
|
|
|
}
|
|
|
String ids="";
|
|
|
for(TypeInfo type:allTypeInfo){
|
|
|
if(ids.equals(""))
|
|
|
ids+=type.getTypeId();
|
|
|
else
|
|
|
ids+=","+type.getTypeId();
|
|
|
}
|
|
|
|
|
|
MObjectInfoReq req=new MObjectInfoReq();
|
|
|
req.setIsType(1);
|
|
|
req.setTypeIds(ids);
|
|
|
return queryMObjectByType(req);
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
DEBUG.error("Failed to query all typeInfo, error: {}", e);
|
|
|
response.setCode(400);
|
|
|
response.setMessage(e.getMessage());
|
|
|
}
|
|
|
|
|
|
return response;
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|