package cn.reghao.oss.console.app.model.vo;

import cn.reghao.oss.console.app.model.po.StoreNode;
import cn.reghao.oss.storeapi.dto.ObjectChannel;
import cn.reghao.oss.storeapi.dto.StoreInfo;
import lombok.Getter;

import java.util.List;

/**
 * @author reghao
 * @date 2024-03-07 14:18:14
 */
@Getter
public class StoreNodeVO {
    private String nodeAddr;
    private Integer httpPort;
    private Integer rpcPort;
    private List<StoreDiskVO> storeDisks;
    private String domain;
    private String referer;
    private String secretKey;
    private List<ObjectChannel> objectChannels;

    public StoreNodeVO(StoreNode storeNode, List<StoreDiskVO> storeDisks, StoreInfo storeInfo) {
        this.nodeAddr = storeNode.getNodeAddr();
        this.httpPort = storeNode.getHttpPort();
        this.rpcPort = storeNode.getRpcPort();
        this.storeDisks = storeDisks;
        this.domain = storeInfo.getStoreProperties().getDomain();
        this.referer = storeInfo.getStoreProperties().getReferer();
        this.secretKey = storeInfo.getStoreProperties().getSecretKey();
        this.objectChannels = storeInfo.getObjectChannels();
    }
}
