package com.xinelu.manage.domain.nursestationpersoncertificate;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;

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

/**
 * 护理员证书资质信息对象 nurse_station_person_certificate
 *
 * @author xinyilu
 * @date 2023-03-29
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "护理员证书资质信息对象", description = "nurse_station_person_certificate")
public class NurseStationPersonCertificate extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -2833200235609433932L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 护理员表id
     */
    @ApiModelProperty(value = "护理员表id")
    @Excel(name = "护理员表id")
    private Long nurseStationPersonId;

    /**
     * 证书名称
     */
    @ApiModelProperty(value = "证书名称")
    @Excel(name = "证书名称")
    @Length(max = 100, message = "证书名称不能超过100个字符")
    private String certificateName;

    /**
     * 证书编号
     */
    @ApiModelProperty(value = "证书编号")
    @Excel(name = "证书编号")
    private String certificateCode;

    /**
     * 证书存放路径
     */
    @ApiModelProperty(value = "证书存放路径")
    @Excel(name = "证书存放路径")
    private String certificateUrl;

    /**
     * 排序
     */
    @Size(min = 0, max = 5, message = "排序不能超过5个字符")
    private Integer sort;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        NurseStationPersonCertificate that = (NurseStationPersonCertificate) o;
        return Objects.equals(nurseStationPersonId, that.nurseStationPersonId) && Objects.equals(certificateUrl, that.certificateUrl);
    }

    @Override
    public int hashCode() {
        return Objects.hash(nurseStationPersonId, certificateUrl);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("nurseStationPersonId", getNurseStationPersonId())
                .append("certificateName", getCertificateName())
                .append("certificateCode", getCertificateCode())
                .append("certificateUrl", getCertificateUrl())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}