package com.xinelu.manage.domain.information;

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;

/**
 * 资讯信息管理对象 information
 *
 * @author xinyilu
 * @date 2023-02-14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "资讯信息管理对象", description = "information")
public class Information extends BaseDomain {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @NotNull(message = "资讯信息不能为空！", groups = {Update.class})
    private Long id;

    /**
     * 资讯所属分类id
     */
    @ApiModelProperty(value = "资讯所属分类id")
    @Excel(name = "资讯所属分类id")
    @NotNull(message = "资讯所属分类信息不能为空！", groups = {Insert.class, Update.class})
    private Long informationCategoryId;

    /**
     * 资讯标题
     */
    @ApiModelProperty(value = "资讯标题")
    @Excel(name = "资讯标题")
    @NotBlank(message = "资讯标题不能为空！", groups = {Insert.class, Update.class})
    private String informationTitle;

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

    /**
     * 资讯图文内容，富文本
     */
    @ApiModelProperty(value = "资讯图文内容，富文本")
    @Excel(name = "资讯图文内容，富文本")
    @NotBlank(message = "资讯图文内容不能为空！", groups = {Insert.class, Update.class})
    private String informationContent;

    /**
     * 资讯点击次数
     */
    @ApiModelProperty(value = "资讯点击次数")
    @Excel(name = "资讯点击次数")
    private Integer informationClickCount;

    /**
     * 资讯跳转路径
     */
    @ApiModelProperty(value = "资讯跳转路径")
    @Excel(name = "资讯跳转路径")
    private String informationJumpLink;

    /**
     * 资讯来源，枚举类型
     */
    @ApiModelProperty(value = "资讯来源，枚举类型")
    @Excel(name = "资讯来源，枚举类型")
    private String informationSource;

    /**
     * 资讯主缩略图地址
     */
    @ApiModelProperty(value = "资讯主缩略图地址")
    @Excel(name = "资讯主缩略图地址")
    @NotBlank(message = "资讯主缩略图地址不能为空！", groups = {Insert.class, Update.class})
    private String leadThumbnailUrl;

    /**
     * 资讯负缩略图1地址
     */
    @ApiModelProperty(value = "资讯负缩略图1地址")
    @Excel(name = "资讯负缩略图1地址")
    private String negativeOneThumbnailUrl;

    /**
     * 资讯负缩略图2地址
     */
    @ApiModelProperty(value = "资讯负缩略图2地址")
    @Excel(name = "资讯负缩略图2地址")
    private String negativeTwoThumbnailUrl;

    /**
     * 资讯大图地址
     */
    @ApiModelProperty(value = "资讯大图地址")
    @Excel(name = "资讯大图地址")
    private String largePictureUrl;

    /**
     * 显示顺序
     */
    @ApiModelProperty(value = "显示顺序")
    @Excel(name = "显示顺序")
    @NotNull(message = "显示顺序不能为空！", groups = {Insert.class, Update.class})
    @Size(min = 0, max = 5, message = "显示顺序不能超过5个字符")
    private Integer informationSort;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("informationCategoryId", getInformationCategoryId())
                .append("informationTitle", getInformationTitle())
                .append("informationCode", getInformationCode())
                .append("informationContent", getInformationContent())
                .append("informationClickCount", getInformationClickCount())
                .append("informationJumpLink", getInformationJumpLink())
                .append("informationSource", getInformationSource())
                .append("leadThumbnailUrl", getLeadThumbnailUrl())
                .append("negativeOneThumbnailUrl", getNegativeOneThumbnailUrl())
                .append("negativeTwoThumbnailUrl", getNegativeTwoThumbnailUrl())
                .append("largePictureUrl", getLargePictureUrl())
                .append("informationSort", getInformationSort())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
