package com.ruoyi.base.commonproblem.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.filepathsplicing.FilePathRich;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 常见问题业务对象 tb_common_problem
 *
 * @author xiechao
 * @date 2023-12-21
 */

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("常见问题业务对象")
public class CommonProblemBo extends BaseEntity {

    /**
     * ID
     */
    @ApiModelProperty(value = "ID", required = true)
    @NotNull(message = "ID不能为空", groups = { EditGroup.class })
    private Integer id;

    /**
     * 问题标题
     */
    @ApiModelProperty(value = "问题标题", required = true)
    @NotBlank(message = "问题标题不能为空", groups = { AddGroup.class, EditGroup.class })
    @Length(message = "问题标题最多255个字",min = 1,max = 255,groups = { AddGroup.class, EditGroup.class })
    private String problemTitle;

    /**
     * 答复内容
     */
    @FilePathRich
    @ApiModelProperty(value = "答复内容", required = true)
    @NotBlank(message = "答复内容不能为空", groups = { AddGroup.class, EditGroup.class })
    private String replyContent;

    /**
     * 排序号
     */
    @ApiModelProperty(value = "排序号", required = true)
    @NotNull(message = "排序号不能为空", groups = { AddGroup.class, EditGroup.class })
    @Range(message = "排序值范围0-99999999", min = 0,max = 99999999L,groups = { AddGroup.class, EditGroup.class })
    private Integer sort;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态（未使用）")
    private Boolean status;

    /**
     * 开始日期(查询用)
     */
    @ApiModelProperty(value = "开始日期(查询用)", required = true)
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;

    /**
     * 结束日期(查询用)
     */
    @ApiModelProperty(value = "结束日期(查询用)", required = true)
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;



}
