|
|
@@ -1,6 +1,7 @@
|
|
|
package cn.reghao.autodop.dmaster.machine.service;
|
|
|
|
|
|
import cn.reghao.autodop.dmaster.machine.db.crud.MachineHostCrud;
|
|
|
+import cn.reghao.autodop.dmaster.machine.db.query.MachineHostQuery;
|
|
|
import cn.reghao.autodop.dmaster.machine.db.query.MachineQuery;
|
|
|
import cn.reghao.autodop.dmaster.machine.model.po.MachineHost;
|
|
|
import cn.reghao.autodop.dmaster.machine.model.po.SshAuth;
|
|
|
@@ -16,10 +17,12 @@ import java.util.List;
|
|
|
@Deprecated
|
|
|
@Service
|
|
|
public class MachineService {
|
|
|
+ private final MachineHostQuery hostQuery;
|
|
|
private final MachineHostCrud hostCrudService;
|
|
|
private final MachineQuery machineQuery;
|
|
|
|
|
|
- public MachineService(MachineHostCrud hostCrudService, MachineQuery machineQuery) {
|
|
|
+ public MachineService(MachineHostQuery hostQuery, MachineHostCrud hostCrudService, MachineQuery machineQuery) {
|
|
|
+ this.hostQuery = hostQuery;
|
|
|
this.hostCrudService = hostCrudService;
|
|
|
this.machineQuery = machineQuery;
|
|
|
}
|
|
|
@@ -31,7 +34,7 @@ public class MachineService {
|
|
|
}
|
|
|
|
|
|
public void setSshAuth(String machineId, SshAuth sshAuth) {
|
|
|
- MachineHost machineHost = machineQuery.query(machineId);
|
|
|
+ MachineHost machineHost = hostQuery.findByMachineId(machineId);
|
|
|
machineHost.setSshAuth(sshAuth);
|
|
|
hostCrudService.save(machineHost);
|
|
|
}
|