package com.cm.common.plugin.pojo.dtos.database.table;

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

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: TableColumnDto
 * @Description: //TODO
 * @Author: WangGeng
 * @Date: 2019/11/15 13:47
 * @Version: 1.0
 **/
@ApiModel
public class TableColumnDTO {

    @ApiModelProperty(name = "columnName", value = "列名")
    private String columnName;
    @ApiModelProperty(name = "columnDefault", value = "默认")
    private String columnDefault;
    @ApiModelProperty(name = "isNullable", value = "是否为空")
    private String isNullable;
    @ApiModelProperty(name = "dataType", value = "数据类型")
    private String dataType;
    @ApiModelProperty(name = "characterMaximumLength", value = "字符最大长度")
    private Long characterMaximumLength;
    @ApiModelProperty(name = "numericPrecision", value = "数字精度")
    private Long numericPrecision;
    @ApiModelProperty(name = "numericScale", value = "数字范围")
    private Long numericScale;
    @ApiModelProperty(name = "datetimePrecision", value = "时间精度")
    private Long datetimePrecision;
    @ApiModelProperty(name = "columnType", value = "列类型")
    private String columnType;
    @ApiModelProperty(name = "columnKey", value = "主键")
    private String columnKey;
    @ApiModelProperty(name = "columnComment", value = "说明")
    private String columnComment;
    @ApiModelProperty(name = "extra", value = "附加")
    private String extra;

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public String getColumnDefault() {
        return columnDefault;
    }

    public void setColumnDefault(String columnDefault) {
        this.columnDefault = columnDefault;
    }

    public String getIsNullable() {
        return isNullable;
    }

    public void setIsNullable(String isNullable) {
        this.isNullable = isNullable;
    }

    public String getDataType() {
        return dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public Long getCharacterMaximumLength() {
        return characterMaximumLength;
    }

    public void setCharacterMaximumLength(Long characterMaximumLength) {
        this.characterMaximumLength = characterMaximumLength;
    }

    public Long getNumericPrecision() {
        return numericPrecision;
    }

    public void setNumericPrecision(Long numericPrecision) {
        this.numericPrecision = numericPrecision;
    }

    public Long getNumericScale() {
        return numericScale;
    }

    public void setNumericScale(Long numericScale) {
        this.numericScale = numericScale;
    }

    public Long getDatetimePrecision() {
        return datetimePrecision;
    }

    public void setDatetimePrecision(Long datetimePrecision) {
        this.datetimePrecision = datetimePrecision;
    }

    public String getColumnType() {
        return columnType;
    }

    public void setColumnType(String columnType) {
        this.columnType = columnType;
    }

    public String getColumnKey() {
        return columnKey;
    }

    public void setColumnKey(String columnKey) {
        this.columnKey = columnKey;
    }

    public String getColumnComment() {
        return columnComment;
    }

    public void setColumnComment(String columnComment) {
        this.columnComment = columnComment;
    }

    public String getExtra() {
        return extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"columnName\":\"")
                .append(columnName).append('\"');
        sb.append(",\"columnDefault\":\"")
                .append(columnDefault).append('\"');
        sb.append(",\"isNullable\":\"")
                .append(isNullable).append('\"');
        sb.append(",\"dataType\":\"")
                .append(dataType).append('\"');
        sb.append(",\"characterMaximumLength\":")
                .append(characterMaximumLength);
        sb.append(",\"numericPrecision\":")
                .append(numericPrecision);
        sb.append(",\"numericScale\":")
                .append(numericScale);
        sb.append(",\"datetimePrecision\":")
                .append(datetimePrecision);
        sb.append(",\"columnType\":\"")
                .append(columnType).append('\"');
        sb.append(",\"columnKey\":\"")
                .append(columnKey).append('\"');
        sb.append(",\"columnComment\":\"")
                .append(columnComment).append('\"');
        sb.append(",\"extra\":\"")
                .append(extra).append('\"');
        sb.append('}');
        return sb.toString();
    }
}
