package com.friday.custody.dto;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Objects;

/**
 * 
 * 
 * @author lyb
 * @email k0051582@gmail.com
 * @date 2022-01-05 14:07:22
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class TenantEscrowAuthorizationInfoDto implements Serializable {

	/**
	 * id
	 */
	private Integer id;
	/**
	 * 租户名(登记编号)
	 */
	private String tenantName;
	/**
	 * 账户联系人
	 */
	private String contactPerson;
	/**
	 * 托管人id：取自字典表：托管人
	 */
	private String trustNo;
	/**
	 * 授权账号
	 */
	private String appKey;
	/**
	 * 授权密码
	 */
	private String appSecret;
	/**
	 * 授权公司id
	 */
	private String companyId;
	/**
	 * 授权文件
	 */
	@JSONField(serialize=false)
	private MultipartFile[] files;
	/**
	 * 授权文件路径
	 */
	private String filePath;
	/**
	 * 版本
	 */
	private String version;
	/**
	 * 备注
	 */
	private String remark;
	/**
	 * 创建时间
	 */
	private String createTime;
	/**
	 * 更新时间
	 */
	private String updateTime;

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		TenantEscrowAuthorizationInfoDto that = (TenantEscrowAuthorizationInfoDto) o;
		return Objects.equals(id, that.id) && Objects.equals(tenantName, that.tenantName) && Objects.equals(contactPerson, that.contactPerson) && Objects.equals(trustNo, that.trustNo) && Objects.equals(appKey, that.appKey) && Objects.equals(appSecret, that.appSecret) && Objects.equals(companyId, that.companyId) && Arrays.equals(files, that.files) && Objects.equals(filePath, that.filePath) && Objects.equals(version, that.version) && Objects.equals(remark, that.remark) && Objects.equals(createTime, that.createTime) && Objects.equals(updateTime, that.updateTime);
	}

	@Override
	public int hashCode() {
		int result = Objects.hash(id, tenantName, contactPerson, trustNo, appKey, appSecret, companyId, filePath, version, remark, createTime, updateTime);
		result = 31 * result + Arrays.hashCode(files);
		return result;
	}
}
