package com.usky.data.vo;

import com.usky.data.domain.DataLink;
import lombok.Data;

/**
 * 数据源详细信息VO
 */
@Data
public class DbLinkInfoVO {
    private Integer id;
    private String fullName;
    private String dbType;
    private String host;
    private Integer port;
    private String dbName;
    private String serviceName;
    private String description;
    private String dbSchema;
    private String tableSpace;
    private String oracleParam;
    private Integer oracleExtend;
    private Integer sortCode;
    private String createBy;
    private String updateBy;

    /**
     * 转换为VO对象
     */
    public DbLinkInfoVO getDbLinkInfoVO(DataLink dataLink) {
        DbLinkInfoVO vo = new DbLinkInfoVO();
        vo.setId(dataLink.getId());
        vo.setFullName(dataLink.getFullName());
        vo.setDbType(dataLink.getDbType());
        vo.setHost(dataLink.getHost());
        vo.setPort(dataLink.getPort());
        vo.setDbName(dataLink.getDbName());
        vo.setServiceName(dataLink.getServiceName());
        vo.setDescription(dataLink.getDescription());
        vo.setDbSchema(dataLink.getDbSchema());
        vo.setTableSpace(dataLink.getTableSpace());
        vo.setOracleParam(dataLink.getOracleParam());
        vo.setOracleExtend(dataLink.getOracleExtend());
        vo.setSortCode(dataLink.getSortCode());
        vo.setCreateBy(dataLink.getCreateBy());
        vo.setUpdateBy(dataLink.getUpdateBy());
        return vo;
    }
}