package com.bohuikeji.frame.module.admin.entity.configure;

import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.SuperBase;
import com.bohuikeji.frame.module.admin.enums.ColumnTypeEnum;
import lombok.Data;

/**
 * 表格属性配置
 * @author 10552
 */
@Data
public class TableAn extends SuperBase {
    boolean show;
    /**
     * 格式化方法
     */
    String format;
    ColumnTypeEnum dataType;

    public static TableAn getInstance(TableShowField showField){
        if (showField==null){return null;}
        TableAn tableAn=new TableAn();
        tableAn.setShow(showField.show());
        tableAn.setDataType(showField.type());
        tableAn.setFormat("formatter_"+tableAn.getDataType().toString());
        return tableAn;
    }

}
