package cn.reghao.tnb.file.app.zoss.model.vo;

import cn.reghao.tnb.file.app.zoss.model.po.StoreNode;
import lombok.Getter;

/**
 * @author reghao
 * @date 2024-08-23 17:47:49
 */
@Getter
public class StoreNodeInfo {
    private int id;
    private String nodeAddr;
    private int httpPort;
    private int rpcPort;
    private String total;
    private String used;
    private double percent;
    private String status;
    private boolean enabled;

    public StoreNodeInfo(StoreNode storeNode, String total, String used, double percent) {
        this.id = storeNode.getId();
        this.nodeAddr = storeNode.getNodeAddr();
        this.httpPort = storeNode.getHttpPort();
        this.rpcPort = storeNode.getRpcPort();
        this.total = total;
        this.used = used;
        this.percent = percent;
        this.status = storeNode.getEnabled() ? "可读写" : "只读";
        this.enabled = storeNode.getEnabled();
    }
}
