/**
 * 
 */
package org.springblade.etl.connector.base;

import java.io.Serializable;
import java.util.Map;

import org.springblade.etl.connector.source.enums.FieldType;
import org.springblade.etl.engine.seatunnel.SeaTunnelConstant;
import org.springblade.etl.enums.JdbcType;
import org.springblade.etl.enums.PluginType;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author wookvn
 *
 */
@Data
public class SeatunnelConfig implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@JsonProperty(value = SeaTunnelConstant.PLUGIN_NAME, required = true)
	private String pluginName;
	
	private Integer parallelism;
	
	//=====>>>以下三个参数为冗余参数，只参与业务逻辑，不构造seatunnel-config文件<<<========
	@JsonProperty(value = SeaTunnelConstant.PLUGIN_TYPE)
	private PluginType pluginType;
	//如果connector包没有打进去jdbc驱动，需要设置该配置
	@JsonProperty(value = SeaTunnelConstant.JDBC_TYPE)
	public JdbcType jdbcType;
	@JsonProperty(value = SeaTunnelConstant.NODE_ID)
	public Integer nodeId;
	
	@Data
	@AllArgsConstructor
	@NoArgsConstructor
	public static class SchemaField{
		//key: [fieldName]
		//value: [类型] org.apache.seatunnel.api.table.type.SqlType
		private Map<String, FieldType> fields;
	}
}
