Search in sources :

Example 1 with MachineInfoVO

use of com.orion.ops.entity.vo.MachineInfoVO in project orion-ops by lijiahangmax.

the class MachineInfoServiceImpl method machineDetail.

@Override
public MachineInfoVO machineDetail(Long id) {
    MachineInfoDO machine = machineInfoDAO.selectById(id);
    Valid.notNull(machine, MessageConst.INVALID_MACHINE);
    MachineInfoVO vo = Converts.to(machine, MachineInfoVO.class);
    Optional.ofNullable(machine.getProxyId()).map(machineProxyDAO::selectById).ifPresent(p -> {
        vo.setProxyHost(p.getProxyHost());
        vo.setProxyPort(p.getProxyPort());
        vo.setProxyType(p.getProxyType());
    });
    return vo;
}
Also used : MachineInfoDO(com.orion.ops.entity.domain.MachineInfoDO) MachineInfoVO(com.orion.ops.entity.vo.MachineInfoVO)

Aggregations

MachineInfoDO (com.orion.ops.entity.domain.MachineInfoDO)1 MachineInfoVO (com.orion.ops.entity.vo.MachineInfoVO)1