Authored by qinchao

添加方法

... ... @@ -36,6 +36,8 @@ public interface IMObjectInfoService {
Map<String,List<MObjectInfo>> getZookeeperMobjectMap();
Map<String,List<MObjectInfo>> getRabbitmqMobjectMap();
List<MysqlMobjectRep> getMysqlMobject();
DependencyRep queryDependency(String group);
... ...
... ... @@ -146,6 +146,13 @@ public class MObjectInfoServiceImpl implements IMObjectInfoService {
}
@Override
public Map<String,List<MObjectInfo>> getRabbitmqMobjectMap(){
Set<String> nameSet=new LinkedHashSet<>();
String[] pathArray="YOHO,middleware,rabbitmq,java_rabbitmq".split(",");
return this.getMobjectMapByPath(pathArray,nameSet);
}
@Override
public List<MysqlMobjectRep> getMysqlMobject() {
List<MysqlMobjectRep> mysqlMobjectList=new ArrayList<>();
Set<String> nameSet=new LinkedHashSet<>();
... ...
... ... @@ -154,11 +154,39 @@ public class RabbitmqCtrl {
return baseResponse;
}
@RequestMapping(value = "/allRabbitMqInMap")
public BaseResponse allRabbitMqInMap(@RequestBody QueryRequest request) {
BaseResponse response = new BaseResponse();
Map<String,List<RabbitModel>> rtnMap=new LinkedHashMap<>();
List<RabbitModel> rabbitModelList =getRabbitMqList(request);
if(rabbitModelList!=null&&rabbitModelList.size()>0){
//再组织成map
Map<String,List<MObjectInfo>> mapTmp=moService.getRabbitmqMobjectMap();
if(mapTmp!=null&&mapTmp.size()>0){
for(String key:mapTmp.keySet()){
rtnMap.put(key,new ArrayList<>());
}
for(RabbitModel rm:rabbitModelList){
if(rtnMap.containsKey(rm.getMoTypeName())){
rtnMap.get(rm.getMoTypeName()).add(rm);
}
}
}
}
response.setData(rtnMap);
return response;
}
@RequestMapping(value = "/allRabbitMq")
public BaseResponse queryAllRabbit(@RequestBody QueryRequest request) {
BaseResponse response = new BaseResponse();
response.setData(getRabbitMqList(request));
return response;
}
private List<RabbitModel> getRabbitMqList( QueryRequest request){
List<RabbitModel> rabbitModelList = new ArrayList<>();
if (StringUtils.equals(InterVar.AWS_TYPE, request.getMoType())) {
... ... @@ -195,10 +223,7 @@ public class RabbitmqCtrl {
}
}
}
response.setData(rabbitModelList);
return response;
return rabbitModelList;
}
... ...