package com.cm.common.plugin.pojo.dtos.dynamic;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: DynamicFormDTO
 * @Description: 动态表单
 * @Author: WangGeng
 * @Date: 2019/12/4 16:58
 * @Version: 1.0
 **/
@ApiModel
public class DynamicFormDTO {

    @ApiModelProperty(name = "id", value = "id")
    private String id;
    @ApiModelProperty(name = "tableName", value = "表名")
    private String tableName;
    @ApiModelProperty(name = "fieldName", value = "字段")
    private String fieldName;
    @ApiModelProperty(name = "fieldExplain", value = "字段说明")
    private String fieldExplain;
    @ApiModelProperty(name = "fieldType", value = "字段类型")
    private String fieldType;
    @ApiModelProperty(name = "fieldDefault", value = "字段默认")
    private String fieldDefault;
    @ApiModelProperty(name = "dictionaryId", value = "字典")
    private String dictionaryId;
    @ApiModelProperty(name = "verifyType", value = "校验类型")
    private String verifyType;
    @ApiModelProperty(name = "verifyRegular", value = "校验正则")
    private String verifyRegular;
    @ApiModelProperty(name = "fieldSort", value = "字段排序")
    private Integer fieldSort;
    @ApiModelProperty(name = "listShow", value = "列表显示")
    private Integer listShow;
    @ApiModelProperty(name = "listShowWidth", value = "列表宽度")
    private Integer listShowWidth;
    @ApiModelProperty(name = "formShow", value = "表单显示")
    private Integer formShow;
    @ApiModelProperty(name = "joinTable", value = "联表")
    private String joinTable;
    @ApiModelProperty(name = "joinTableField", value = "联表字段")
    private String joinTableField;
    @ApiModelProperty(name = "joinTableSort", value = "联表顺序")
    private Integer joinTableSort;
    @ApiModelProperty(name = "joinTableListShow", value = "联表列表显示")
    private String joinTableListShow;
    @ApiModelProperty(name = "joinTableFormShow", value = "联表表单显示")
    private String joinTableFormShow;

    public String getId() {
        return id == null ? "" : id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTableName() {
        return tableName == null ? "" : tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getFieldName() {
        return fieldName == null ? "" : fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getFieldExplain() {
        return fieldExplain == null ? "" : fieldExplain;
    }

    public void setFieldExplain(String fieldExplain) {
        this.fieldExplain = fieldExplain;
    }

    public String getFieldType() {
        return fieldType == null ? "" : fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    public String getFieldDefault() {
        return fieldDefault == null ? "" : fieldDefault;
    }

    public void setFieldDefault(String fieldDefault) {
        this.fieldDefault = fieldDefault;
    }

    public String getDictionaryId() {
        return dictionaryId == null ? "" : dictionaryId;
    }

    public void setDictionaryId(String dictionaryId) {
        this.dictionaryId = dictionaryId;
    }

    public String getVerifyType() {
        return verifyType == null || verifyRegular.isEmpty() ? "none" : verifyType;
    }

    public void setVerifyType(String verifyType) {
        this.verifyType = verifyType;
    }

    public String getVerifyRegular() {
        return verifyRegular == null ? "" : verifyRegular;
    }

    public void setVerifyRegular(String verifyRegular) {
        this.verifyRegular = verifyRegular;
    }

    public Integer getFieldSort() {
        return fieldSort;
    }

    public void setFieldSort(Integer fieldSort) {
        this.fieldSort = fieldSort;
    }

    public Integer getListShow() {
        return listShow;
    }

    public void setListShow(Integer listShow) {
        this.listShow = listShow;
    }

    public Integer getListShowWidth() {
        return listShowWidth;
    }

    public void setListShowWidth(Integer listShowWidth) {
        this.listShowWidth = listShowWidth;
    }

    public Integer getFormShow() {
        return formShow;
    }

    public void setFormShow(Integer formShow) {
        this.formShow = formShow;
    }

    public String getJoinTable() {
        return joinTable == null ? "" : joinTable.trim();
    }

    public void setJoinTable(String joinTable) {
        this.joinTable = joinTable;
    }

    public String getJoinTableField() {
        return joinTableField == null ? "" : joinTableField.trim();
    }

    public void setJoinTableField(String joinTableField) {
        this.joinTableField = joinTableField;
    }

    public Integer getJoinTableSort() {
        return joinTableSort;
    }

    public void setJoinTableSort(Integer joinTableSort) {
        this.joinTableSort = joinTableSort;
    }

    public String getJoinTableListShow() {
        return joinTableListShow == null ? "" : joinTableListShow.trim();
    }

    public void setJoinTableListShow(String joinTableListShow) {
        this.joinTableListShow = joinTableListShow;
    }

    public String getJoinTableFormShow() {
        return joinTableFormShow == null ? "" : joinTableFormShow.trim();
    }

    public void setJoinTableFormShow(String joinTableFormShow) {
        this.joinTableFormShow = joinTableFormShow;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"id\":")
                .append("\"").append(id).append("\"");
        sb.append(",\"tableName\":")
                .append("\"").append(tableName).append("\"");
        sb.append(",\"fieldName\":")
                .append("\"").append(fieldName).append("\"");
        sb.append(",\"fieldExplain\":")
                .append("\"").append(fieldExplain).append("\"");
        sb.append(",\"fieldType\":")
                .append("\"").append(fieldType).append("\"");
        sb.append(",\"fieldDefault\":")
                .append("\"").append(fieldDefault).append("\"");
        sb.append(",\"dictionaryId\":")
                .append("\"").append(dictionaryId).append("\"");
        sb.append(",\"verifyType\":")
                .append("\"").append(verifyType).append("\"");
        sb.append(",\"verifyRegular\":")
                .append("\"").append(verifyRegular).append("\"");
        sb.append(",\"fieldSort\":")
                .append(fieldSort);
        sb.append(",\"listShow\":")
                .append(listShow);
        sb.append(",\"listShowWidth\":")
                .append(listShowWidth);
        sb.append(",\"formShow\":")
                .append(formShow);
        sb.append(",\"joinTable\":")
                .append("\"").append(joinTable).append("\"");
        sb.append(",\"joinTableField\":")
                .append("\"").append(joinTableField).append("\"");
        sb.append(",\"joinTableSort\":")
                .append(joinTableSort);
        sb.append(",\"joinTableListShow\":")
                .append("\"").append(joinTableListShow).append("\"");
        sb.append(",\"joinTableFormShow\":")
                .append("\"").append(joinTableFormShow).append("\"");
        sb.append('}');
        return sb.toString();
    }
}
