
package com.zhiqiyun.open.router.request;

import com.dliyun.oap.framework.annotation.ServiceParamField;
import com.dliyun.oap.framework.request.AbstractOapRequest;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;

@Data
@EqualsAndHashCode(callSuper = true)
public class UploaderBase64Request extends AbstractOapRequest {

	@ServiceParamField(describe = "文件原始文件名")
	@NotBlank
	private String filename;

	@ServiceParamField(describe = "Base64文件")
	@NotBlank
	private String base64File;

	public String getBase64File() {
		if (this.base64File != null) {
			String[] array = this.base64File.split("base64,");
			if (array.length > 1) {
				return array[1];
			}
		}
		return base64File;
	}
}

