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

import com.cm.common.annotation.CheckEmptyAnnotation;
import com.cm.common.annotation.CheckNumberAnnotation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

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

    @ApiModelProperty(name = "fieldName", value = "字段名称")
    @CheckEmptyAnnotation(name = "字段名称")
    private String fieldName;
    @ApiModelProperty(name = "fieldExplain", value = "字段说明")
    @CheckEmptyAnnotation(name = "字段说明")
    private String fieldExplain;
    @ApiModelProperty(name = "fieldType", value = "字段类型")
    @CheckEmptyAnnotation(name = "字段类型", types = {"string", "datetime", "date", "number", "double", "textarea", "richText", "select", "checkbox", "radio", "selectUser", "selectDepartment", "file", "join"})
    private String fieldType;
    @ApiModelProperty(name = "fieldDefault", value = "字段默认值")
    private String fieldDefault;
    @ApiModelProperty(name = "dictionaryId", value = "字典ID")
    private String dictionaryId;
    @ApiModelProperty(name = "verifyType", value = "校验类型")
    @CheckEmptyAnnotation(name = "校验类型", types = {"none", "required", "phone", "email", "url", "number", "date", "identity", "custom"})
    private String verifyType;
    @ApiModelProperty(name = "verifyRegular", value = "校验正则")
    private String verifyRegular;
    @ApiModelProperty(name = "fieldSort", value = "排序")
    private Integer fieldSort;
    @ApiModelProperty(name = "listShow", value = "列表显示")
    @CheckNumberAnnotation(name = "列表显示", types = {"0", "1"})
    private Integer listShow;
    @ApiModelProperty(name = "formShow", value = "表单显示")
    @CheckNumberAnnotation(name = "表单显示", types = {"0", "1"})
    private Integer formShow;

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

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

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

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

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

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

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

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

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

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

    public String getVerifyType() {
        return verifyType == null ? "" : verifyType.trim();
    }

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

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

    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 getFormShow() {
        return formShow;
    }

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

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        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(",\"formShow\":")
                .append(formShow);
        sb.append('}');
        return sb.toString();
    }
}
