/**
 * 
 */
package org.springblade.etl.connector.transform.config;

import java.util.List;

import javax.validation.constraints.NotEmpty;

import org.springblade.etl.connector.base.SeatunnelConfig;

import com.fasterxml.jackson.annotation.JsonProperty;

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

/**
 * @author wookvn
 *
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SeatunnelRowStackTransformConfig extends SeatunnelConfig {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private List<String> fields;
	
	@JsonProperty("field_types")
	private List<String> fieldTypes;
	
	@JsonProperty("field_config")
	private List<FieldConfig> fieldConfigs;

	@Data
	public static class FieldConfig{
		private String sourceTable;
		private List<FieldMapping> list;
	}
	
	@Data
	public static class FieldMapping{
		@ApiModelProperty("原表字段名")
		@NotEmpty(message = "行堆叠组件：原字段名不能为空")
		private String column;
		@ApiModelProperty("目标字段名")
		@NotEmpty(message = "行堆叠组件：目标字段名不能为空")
		private String mainColumn;
	}
}
