|
|
@@ -0,0 +1,61 @@
|
|
|
+package cn.reghao.bnt.web.devops.machine.model.po;
|
|
|
+
|
|
|
+import cn.reghao.bnt.common.machine.model.SysProcess;
|
|
|
+import cn.reghao.bnt.web.util.BaseEntity;
|
|
|
+import jakarta.persistence.CollectionTable;
|
|
|
+import jakarta.persistence.ElementCollection;
|
|
|
+import jakarta.persistence.Entity;
|
|
|
+import jakarta.persistence.Table;
|
|
|
+import lombok.Getter;
|
|
|
+import lombok.NoArgsConstructor;
|
|
|
+import lombok.Setter;
|
|
|
+import org.hibernate.annotations.LazyCollection;
|
|
|
+import org.hibernate.annotations.LazyCollectionOption;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author reghao
|
|
|
+ * @date 2025-12-17 15:58:08
|
|
|
+ */
|
|
|
+@NoArgsConstructor
|
|
|
+@Getter
|
|
|
+@Setter
|
|
|
+@Entity
|
|
|
+@Table(name = "devops_machine_proc")
|
|
|
+public class MachineProc extends BaseEntity {
|
|
|
+ private String machineId;
|
|
|
+ private Integer pid;
|
|
|
+ private String name;
|
|
|
+ private Integer ppid;
|
|
|
+ private String cmdLine;
|
|
|
+ private String bindAddress;
|
|
|
+ private Long startTime;
|
|
|
+ private String user;
|
|
|
+ private String containerId;
|
|
|
+ private String appId;
|
|
|
+
|
|
|
+ public MachineProc(String machineId, SysProcess sysProcess, String bindAddress) {
|
|
|
+ this.machineId = machineId;
|
|
|
+ this.pid = sysProcess.getPid();
|
|
|
+ this.name = sysProcess.getName();
|
|
|
+ this.ppid = sysProcess.getPpid();
|
|
|
+ this.cmdLine = sysProcess.getCmdLine();
|
|
|
+ this.bindAddress = bindAddress;
|
|
|
+ this.startTime = sysProcess.getStartTime();
|
|
|
+ this.user = sysProcess.getUser();
|
|
|
+ this.containerId = sysProcess.getContainerId();
|
|
|
+ this.appId = sysProcess.getAppId();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void update(SysProcess sysProcess) {
|
|
|
+ this.pid = sysProcess.getPid();
|
|
|
+ this.name = sysProcess.getName();
|
|
|
+ this.ppid = sysProcess.getPpid();
|
|
|
+ this.cmdLine = sysProcess.getCmdLine();
|
|
|
+ this.startTime = sysProcess.getStartTime();
|
|
|
+ this.user = sysProcess.getUser();
|
|
|
+ this.containerId = sysProcess.getContainerId();
|
|
|
+ this.appId = sysProcess.getAppId();
|
|
|
+ }
|
|
|
+}
|