package com.cyksj.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.ejlchina.searcher.bean.DbIgnore;
import lombok.Data;

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

/**
 * @author chan
 * @date 2022/3/15 上午11:17
 */
@Data
public class CorpUserTag extends BaseEntity implements Serializable {

	/**
	 * corp_user_follow_relation_id 关联id
	 */
	private Long relationId;

	/**
	 * 该成员添加此外部联系人所打标签的分组名称
	 */
	private String groupName;

	/**
	 * 该成员添加此外部联系人所打标签名称
	 */
	private String tagName;

	/**
	 * 该成员添加此外部联系人所打企业标签的id，仅企业设置（type为1）的标签返回
	 */
	private String tagId;

	/**
	 * 该成员添加此外部联系人所打标签类型, 1-企业设置, 2-用户自定义
	 */
	private int type;

	@DbIgnore
	@TableField(exist = false)
	private String followId;

	@DbIgnore
	@TableField(exist = false)
	private String externalUserId;

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		CorpUserTag that = (CorpUserTag) o;
		return type == that.type &&
				relationId.equals(that.relationId) &&
				groupName.equals(that.groupName) &&
				tagName.equals(that.tagName) &&
				tagId.equals(that.tagId);
	}

	@Override
	public int hashCode() {
		return Objects.hash(relationId, groupName, tagName, tagId, type);
	}
}
