package cn.fateverse.query.entity.vo;

import cn.fateverse.query.entity.TableColumn;
import lombok.Builder;
import lombok.Data;

/**
 * @author Clay
 * @date 2023-07-19
 */
@Data
@Builder
public class TableColumnVo {

    private Long tableId;

    private Long columnId;

    private String columnName;

    private String columnComment;

    private String columnType;

    private Boolean pk;

    private Boolean use;


    public static TableColumnVo toTableColumnVo(TableColumn column){
        return TableColumnVo.builder()
                .tableId(column.getTableId())
                .columnId(column.getColumnId())
                .columnName(column.getColumnName())
                .columnComment(column.getColumnComment())
                .columnType(column.getColumnType())
                .pk(column.getPk())
                .use(column.getUse())
                .build();
    }

}
