package com.xinelu.applet.vo.diseaseinfo;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author ljh
 * @version 1.0
 * Create by 2022/11/11 13:36
 */
@Data
public class DiseasesInfoVO extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -3461137370921513980L;
    /***
     * 疾病id
     **/
    private Long diseaseId;

    /***
     * 人员id
     **/
    private Long patientId;


    /**
     * 主键id
     */
    @NotNull(message = "请选择疾病信息", groups = {Update.class})
    private Long id;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    @Excel(name = "用户id")
    private Long userId;

    /**
     * 疾病唯一编码
     */
    @ApiModelProperty(value = "疾病唯一编码")
    @Excel(name = "疾病唯一编码")
    private String diseaseCode;

    /**
     * 疾病名称
     */
    @ApiModelProperty(value = "疾病名称")
    @Excel(name = "疾病名称")
    @NotNull(message = "疾病名称不能为空", groups = {Insert.class, Update.class})
    @Length(max = 50, message = "疾病名称不能超过50个字符", groups = {Insert.class, Update.class})
    private String diseaseName;

    /**
     * 疾病描述
     */
    @ApiModelProperty(value = "疾病描述")
    @Excel(name = "疾病描述")
    @NotNull(message = "疾病描述不能为空", groups = {Insert.class, Update.class})
    @Length(max = 100, message = "疾病描述不能超过100个字符", groups = {Insert.class, Update.class})
    private String description;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @Excel(name = "排序")
    @NotNull(message = "排序不能为空", groups = {Insert.class, Update.class})
    private Integer sort;


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        DiseasesInfoVO that = (DiseasesInfoVO) o;
        return Objects.equals(diseaseId, that.diseaseId) && Objects.equals(diseaseName, that.diseaseName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(diseaseId, diseaseName);
    }
}
