package com.xinelu.manage.domain.nurseclassifyinfo;

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.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
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.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 护理机构和护理项目分类信息对象 nurse_classify_info
 *
 * @author xinyilu
 * @date 2023-02-08
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "护理机构和护理项目分类信息对象", description = "nurse_classify_info")
public class NurseClassifyInfo extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -5375302736623261278L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 父级分类id
     */
    @ApiModelProperty(value = "父级分类id")
    @Excel(name = "父级分类id")
    private Long parentId;

    /**
     * 分类编码
     */
    @ApiModelProperty(value = "分类编码")
    @Excel(name = "分类编码")
    private String classifyCode;

    /**
     * 分类名称
     */
    @ApiModelProperty(value = "分类名称")
    @Excel(name = "分类名称")
    @Length(max = 30, message = "分类名称不能超过30个字符", groups = {Insert.class, Update.class})
    @NotBlank(message = "分类名称不能为空", groups = {Insert.class, Update.class})
    private String classifyName;

    /**
     * 分类级别
     */
    @ApiModelProperty(value = "分类级别")
    @Excel(name = "分类级别")
    private Integer classifyLevel;

    /**
     * 分类所属类型，NURSE_AGENCY：护理机构分类，NURSE_ITEM：护理项目分类
     */
    @ApiModelProperty(value = "分类所属类型，NURSE_AGENCY：护理机构分类，NURSE_ITEM：护理项目分类")
    @Excel(name = "分类所属类型，NURSE_AGENCY：护理机构分类，NURSE_ITEM：护理项目分类")
    private String classifyType;

    /**
     * 分类图标存放地址
     */
    @ApiModelProperty(value = "分类图标存放地址")
    @Excel(name = "分类图标存放地址")
    @NotBlank(message = "分类图标不能为空", groups = {Insert.class, Update.class})
    private String classifyPictureUrl;

    /**
     * 分类排序
     */
    @ApiModelProperty(value = "分类排序")
    @Excel(name = "分类排序")
    @Size(min = 0, max = 5, message = "分类排序不能超过5个字符")
    private Integer classifySort;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("parentId", getParentId())
                .append("classifyCode", getClassifyCode())
                .append("classifyName", getClassifyName())
                .append("classifyLevel", getClassifyLevel())
                .append("classifyType", getClassifyType())
                .append("classifyPictureUrl", getClassifyPictureUrl())
                .append("classifySort", getClassifySort())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
