package com.xinelu.manage.domain.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.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;

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

/**
 * 疾病信息字典对象 disease_info
 *
 * @author 纪寒
 * @date 2022-09-02
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "疾病信息字典对象", description = "disease_info")
public class DiseaseInfo extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -3668410738484204313L;
    /**
     * 主键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 String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("userId", getUserId())
                .append("diseaseCode", getDiseaseCode())
                .append("diseaseName", getDiseaseName())
                .append("sort", getSort())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
