Search in sources :

Example 1 with ServerPO

use of com.ibeiliao.deployment.admin.po.server.ServerPO in project Corgi by kevinYin.

the class ServerServiceImpl method getByModuleId.

@Override
public List<Server> getByModuleId(int moduleId) {
    Assert.isTrue(moduleId > 0, "moduleId数值非法");
    List<ServerGroup> serverGroups = serverGroupService.getByModuleIds(Lists.newArrayList(moduleId), false);
    if (CollectionUtils.isEmpty(serverGroups)) {
        return Collections.emptyList();
    }
    List<Integer> groupIds = Lists.newArrayList();
    for (ServerGroup group : serverGroups) {
        groupIds.add(group.getGroupId());
    }
    List<ServerPO> serverPOs = serverDao.getByGroupIds(groupIds);
    if (CollectionUtils.isEmpty(serverPOs)) {
        return Collections.emptyList();
    }
    return VOUtil.fromList(serverPOs, Server.class);
}
Also used : ServerGroup(com.ibeiliao.deployment.admin.vo.server.ServerGroup) ServerPO(com.ibeiliao.deployment.admin.po.server.ServerPO)

Example 2 with ServerPO

use of com.ibeiliao.deployment.admin.po.server.ServerPO in project Corgi by kevinYin.

the class ServerServiceImpl method getById.

@Override
public Server getById(int serverId) {
    Assert.isTrue(serverId > 0, "服务器id 不大于0 !");
    ServerPO serverPO = serverDao.get(serverId);
    return VOUtil.from(serverPO, Server.class);
}
Also used : ServerPO(com.ibeiliao.deployment.admin.po.server.ServerPO)

Aggregations

ServerPO (com.ibeiliao.deployment.admin.po.server.ServerPO)2 ServerGroup (com.ibeiliao.deployment.admin.vo.server.ServerGroup)1