package com.xinyilu.system.domain.itemCategory;

import com.xinyilu.common.annotation.Excel;
import com.xinyilu.common.core.domain.BaseEntity;
import com.xinyilu.common.custominterface.Insert;
import com.xinyilu.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 javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 测试项目分类对象 test_item_category
 *
 * @author jihan
 * @date 2022-08-01
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "测试项目分类对象", description = "test_item_category")
public class TestItemCategory extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -2751262176970435982L;
    /**
     * 主键id
     */
    @NotNull(message = "主键id不能为空", groups = {Update.class})
    private Long id;

    /**
     * 父级id
     */
    private Long parentId;

    /**
     * 分类名称
     */
    @ApiModelProperty(value = "分类名称")
    @NotBlank(message = "分类名称不能为空", groups = {Insert.class, Update.class})
    private String categoryName;

    /**
     * 分类名称简写
     */
    @ApiModelProperty(value = "分类名称简写")
    @NotBlank(message = "分类名称简写不能为空", groups = {Insert.class, Update.class})
    private String categoryNameAbbreviate;

    /**
     * 分类排序
     */
    @ApiModelProperty(value = "分类排序")
    @NotNull(message = "排序不能为空", groups = {Insert.class, Update.class})
    @Size(min = 0, message = "排序最小值为0")
    private Integer sorting;


    /**
     * 分类编号
     */
    @ApiModelProperty(value = "分类编号")
    @Excel(name = "分类编号")
    private String categoryCode;
    /**
     * 是否删除，0：否，1：是
     */
    private Integer delFlag;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("parentId", getParentId())
                .append("categoryName", getCategoryName())
                .append("categoryNameAbbreviate", getCategoryNameAbbreviate())
                .append("sorting", getSorting())
                .append("remark", getRemark())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
