package com.xinelu.manage.domain.informationcategory;

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 javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 资讯分类对象 information_category
 *
 * @author xinyilu
 * @date 2023-02-14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "资讯分类对象", description = "information_category")
public class InformationCategory extends BaseDomain implements Serializable {
    private static final long serialVersionUID = 8225087826554777164L;
    /**
     * 主键id
     */
    @NotNull(message = "资讯分类信息不能为空", groups = {Update.class})
    private Long id;

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

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

    /**
     * 资讯分类类型，健康咨询：HEALTH_NOUS，OTHER：其他
     */
    @ApiModelProperty(value = "资讯分类类型，健康咨询：HEALTH_NOUS，OTHER：其他")
    @Excel(name = "资讯分类类型，健康咨询：HEALTH_NOUS，OTHER：其他")
    @NotBlank(message = "资讯分类类型不能为空", groups = {Insert.class, Update.class})
    private String informationCategoryType;

    /**
     * 资讯分类排序
     */
    @ApiModelProperty(value = "资讯分类排序")
    @Excel(name = "资讯分类排序")
    @NotNull(message = "资讯分类排序", groups = {Insert.class, Update.class})
    @Size(min = 0, max = 5, message = "资讯分类排序不能超过5个字符")
    private Integer sort;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("informationCategoryCode", getInformationCategoryCode())
                .append("informationCategoryName", getInformationCategoryName())
                .append("informationCategoryType", getInformationCategoryType())
                .append("sort", getSort())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
