package com.yanzuoguang.excel;

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

import java.util.ArrayList;
import java.util.List;

/**
 * 订单导出数据
 *
 * @author 颜佐光
 */
@ApiModel(description = "订单导出数据配置信息")
public class ExportData {

    @ApiModelProperty(notes = "行默认高度")
    public static final short ROW_HEIGHT_UNIT = 10;

    @ApiModelProperty(notes = "标题默认高度")
    public static final short TITLE_HEIGHT = 80;

    @ApiModelProperty(notes = "子标题默认高度")
    public static final short SUB_TITLE_HEIGHT = 40;

    @ApiModelProperty(notes = "头默认高度")
    public static final short HEAD_HEIGHT = 40;

    @ApiModelProperty(notes = "行默认高度")
    public static final short ROW_HEIGHT = 30;

    @ApiModelProperty(notes = "列默认宽度")
    public static final short COLUMN_WIDTH = 0;

    /**
     * 服务器保存路径
     */
    @ApiModelProperty(notes = "服务器保存路径")
    private String serverPath;

    /**
     * 文件名
     */
    @ApiModelProperty(notes = "文件名")
    private String fileName;

    /**
     * 下载文件名
     */
    @ApiModelProperty(notes = "下载文件名")
    private String downFileName;

    /**
     * 标题
     */
    @ApiModelProperty(notes = "标题")
    private String title;

    /**
     * 标题高度
     */
    @ApiModelProperty(notes = "标题高度")
    private short titleHeight;

    /**
     * 子标题
     */
    @ApiModelProperty(notes = "子标题")
    private String subTitle;

    /**
     * 子标题高度
     */
    @ApiModelProperty(notes = "子标题高度")
    private short subTitleHeight;

    /**
     * 列标题高度
     */
    @ApiModelProperty(notes = "列标题高度")
    private short headHeight;

    /**
     * 行高度
     */
    @ApiModelProperty(notes = "行高度")
    private short rowHeight;

    /**
     * 包含列
     */
    @ApiModelProperty(notes = "包含列")
    private List<ExportColumn> columns = new ArrayList<>();

    public String getServerPath() {
        return serverPath;
    }

    public void setServerPath(String serverPath) {
        this.serverPath = serverPath;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getDownFileName() {
        return downFileName;
    }

    public void setDownFileName(String downFileName) {
        this.downFileName = downFileName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public short getTitleHeight() {
        if (titleHeight < 1) {
            return TITLE_HEIGHT;
        }
        return titleHeight;
    }

    public void setTitleHeight(short titleHeight) {
        this.titleHeight = titleHeight;
    }

    public String getSubTitle() {
        return subTitle;
    }

    public void setSubTitle(String subTitle) {
        this.subTitle = subTitle;
    }

    public short getSubTitleHeight() {
        if (subTitleHeight < 1) {
            return SUB_TITLE_HEIGHT;
        }
        return subTitleHeight;
    }

    public void setSubTitleHeight(short subTitleHeight) {
        this.subTitleHeight = subTitleHeight;
    }

    public short getHeadHeight() {
        if (headHeight < 1) {
            return HEAD_HEIGHT;
        }
        return headHeight;
    }

    public void setHeadHeight(short headHeight) {
        this.headHeight = headHeight;
    }

    public short getRowHeight() {
        if (rowHeight < 1) {
            return ROW_HEIGHT;
        }
        return rowHeight;
    }

    public void setRowHeight(short rowHeight) {
        this.rowHeight = rowHeight;
    }

    public List<ExportColumn> getColumns() {
        return columns;
    }

    public void setColumns(List<ExportColumn> columns) {
        this.columns = columns;
    }
}