/**
 * 
 */
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 SeatunnelScriptJavaTransformConfig extends SeatunnelConfig {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@JsonProperty("script_content")
	@NotEmpty(message = "JAVA脚本不能为空")
	@ApiModelProperty("java脚本代码")
	private String scriptContent;
	
	@ApiModelProperty("字段列表，一定注意顺序【该顺序与脚本的参数顺序一致】")
	private List<ScriptField> fields;
	
	@Data
	public static class ScriptField{
		@NotEmpty(message = "JAVA脚本组件：字段不能为空")
		@ApiModelProperty("字段名")
		private String field;
		@ApiModelProperty("字段类型")
		private String outputFieldType;
	}
}