package cn.reghao.devops.web.mgr.machine.model.po;

import cn.reghao.jutil.jdk.machine.data.detail.DiskDetail;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Embeddable;
import java.io.Serializable;

/**
 * @author reghao
 * @date 2024-07-26 09:28:35
 */
@NoArgsConstructor
@Data
@Embeddable
public class DiskInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    private String diskPath;
    private String mountedOn;
    private String fsType;
    private Long total;
    private Long avail;
    private Long used;
    private long inodeTotal;
    private long inodeAvail;

    public DiskInfo(DiskDetail diskDetail) {
        this.diskPath = diskDetail.getDiskPath();
        this.mountedOn = diskDetail.getMountedOn();
        this.fsType = diskDetail.getFsType();
        this.total = diskDetail.getTotal();
        this.avail = diskDetail.getAvail();
        this.used = diskDetail.getUsed();
        this.inodeTotal = diskDetail.getInodeTotal();
        this.inodeAvail = diskDetail.getInodeAvail();
    }
}
