package org.springblade.flow.visual.onlinedev.common.excel;

import java.util.List;

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

/**
 * 批量导入表单数据参数
 * 
 * @author william
 * @date 2022年9月14日 下午1:57:56
 */
@Data
@ApiModel(value = "ExcelFormParam", description = "批量导入表单数据参数")
public class ExcelFormParam {

	@ApiModelProperty(value = "表单ID", name = "modelId", required = true)
	private String modelId;

	@ApiModelProperty(value = "excel相对路径", name = "file", required = true)
	private String file;

	@ApiModelProperty(value = "excel是否带表头", name = "withHeader", required = true)
	private Boolean withHeader;

	@ApiModelProperty(value = "字段ID和Excel列索引映射关系", name = "list", required = true)
	private List<ExcelFieldIndex> list;

	@Data
	@ApiModel(value = "ExcelFieldIndex", description = "字段ID和Excel列索引映射关系")
	public static class ExcelFieldIndex {

		public ExcelFieldIndex() {
		}

		public ExcelFieldIndex(Integer index, Integer fieldId) {
			super();
			this.index = index;
			this.fieldId = fieldId;
		}

		@ApiModelProperty(value = "Excel列索引（从0开始）", name = "index", required = true)
		private int index;

		@ApiModelProperty(value = "字段ID", name = "fieldId", required = true)
		private int fieldId;
	}
}
