package com.sckw.excel.config.easyexcel;

import com.sckw.excel.annotation.ExcelSelected;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * @author LengFaQiang
 * @version 1.0.0
 * @ClassName ExcelSelectedResolve.java
 * @Description easy导出设置下拉框
 * @createTime 2022/4/27 10:27
 */
@Data
@Slf4j
public class ExcelSelectedResolve {

    /**
     * 下拉内容
     */
    private String[] source;

    /**
     * 设置下拉框的起始行，默认为第二行
     */
    private int firstRow;

    /**
     * 设置下拉框的结束行，默认为最后一行
     */
    private int lastRow;

    public String[] resolveSelectedSource(ExcelSelected excelSelected) {
        if (excelSelected == null) {
            return null;
        }

        // 获取固定下拉框的内容
        String[] source = excelSelected.source();
        if (source.length > 0) {
            return source;
        }
        return null;
    }

}
