package com.purui.prims.common.pojo;

import com.purui.prims.common.pojo.enums.DataFormatTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class QueryColumn {

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "类型")
    private String type;

    @ApiModelProperty(value = "英文名称")
    private String nameEn;

    @ApiModelProperty(value = "展示类型")
    private String showType;

    @ApiModelProperty(value = "是否授权")
    private Boolean authorized = true;

    @ApiModelProperty(value = "数据格式类型")
    private DataFormatTypeEnum dataFormatType;

    @ApiModelProperty(value = "数据格式")
    private DataFormat dataFormat;

    @ApiModelProperty(value = "备注")
    private String comment;

    public QueryColumn(String nameEn, String type) {
        this.type = type;
        this.nameEn = nameEn;
    }

    public QueryColumn(String name, String type, String nameEn) {
        this.name = name;
        this.type = type;
        this.nameEn = nameEn;
        this.showType = "CATEGORY";
    }

    public void setType(String type) {
        this.type = type == null ? null : type;
    }
}
