首页查询资源详情接口

develop
guyuliang 2024-08-24 18:28:50 +08:00
parent 7f33a805cf
commit 3ce3aec59d
1 changed files with 9 additions and 4 deletions

View File

@ -430,7 +430,7 @@ public class ModuleServiceImpl implements ModuleService {
List<String> nameList = Arrays.asList("网络设备", "物理服务器", "安全设备"); List<String> nameList = Arrays.asList("网络设备", "物理服务器", "安全设备");
//查询根节点 //查询根节点
List<ModuleGroup> rootGroups = moduleGroupRepository.queryRootInName(nameList); List<ModuleGroup> rootGroups = moduleGroupRepository.queryRootInName(nameList);
log.info("moduleGroups:{}", JSON.toJSONString("moduleGroups")); log.info("moduleGroups:{}", JSON.toJSONString(rootGroups));
//查询出所有根节点下的子节点 //查询出所有根节点下的子节点
@ -452,11 +452,16 @@ public class ModuleServiceImpl implements ModuleService {
param.setSign(Sign.EQ); param.setSign(Sign.EQ);
paramList.add(param); paramList.add(param);
pager.setParams(paramList); pager.setParams(paramList);
GeneralResult<JSONObject> list = cmpInternalService.list(pager.toMap()); GeneralResult<JSONObject> result = cmpInternalService.list(pager.toMap());
log.info("list:{}", JSON.toJSONString(list)); if(result.isFailed()){
log.info("list:{}", JSON.toJSONString(result));
return new GeneralResult(false,"查询失败");
}
Map<String,Object> resultMap = new HashMap<>();
resultMap.put("vm",result.getData().getInteger("total"));
return new GeneralResult<>(true, "查询成功"); return new GeneralResult<>(true, resultMap,"查询成功");
} catch (Exception e) { } catch (Exception e) {
log.info("查询失败", e); log.info("查询失败", e);
return new GeneralResult<>(false, "查询失败"); return new GeneralResult<>(false, "查询失败");