package cn.stylefeng.team.portal.modular.management.pojo.request;

import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class PortalNewsRequest extends BaseRequest {

    @NotNull(message = "新闻id不能为空", groups = {edit.class, delete.class, detail.class})
    @ChineseDescription("新闻id")
    private Long newsId;

    @ChineseDescription("门户设计id")
    @NotNull(message = "门户设计id不能为空", groups = {add.class, edit.class, page.class})
    private Long designId;

    @ChineseDescription("新闻所属的分类id")
    @NotNull(message = "门户设计id不能为空", groups = {add.class, edit.class})
    private Long newsCategoryId;

    @ChineseDescription("新闻标题")
    @NotBlank(message = "新闻标题不能为空", groups = {add.class, edit.class})
    private String newsTitle;

    @ChineseDescription("新闻摘要")
    private String newsSummary;

    @ChineseDescription("新闻内容")
    private String newsContent;

    @ChineseDescription("发布时间")
    @NotNull(message = "发布时间不能为空", groups = {add.class, edit.class})
    private Date showPublishTime;

    @ChineseDescription("发布人")
    @NotBlank(message = "发布人不能为空", groups = {add.class, edit.class})
    private String showPublishUser;

    @ChineseDescription("显示的摄影人")
    private String showPhotoUser;

    @ChineseDescription("缩略图封面的文件id")
    private Long coverFileId;

    @ChineseDescription("新闻状态：1-草稿，2-发布")
    @NotNull(message = "新闻状态不能为空", groups = {add.class, edit.class})
    private Integer newsStatus;

    @ChineseDescription("是否置顶：Y-置顶，N-不置顶")
    @NotBlank(message = "是否置顶不能为空", groups = {add.class, edit.class})
    private String newsTopFlag;

    @ChineseDescription("新闻排序")
    @NotNull(message = "新闻排序不能为空", groups = {add.class, edit.class})
    private BigDecimal newsSort;

    @ChineseDescription("文章类型：10-文本文章，20-外部链接")
    @NotNull(message = "文章类型不能为空", groups = {add.class, edit.class})
    private Integer newsType;

    @ChineseDescription("外部链接地址")
    private String linkUrl;

    @NotEmpty(message = "批量删除id集合不能为空", groups = batchDelete.class)
    @ChineseDescription("批量删除用的id集合")
    private List<Long> batchDeleteIdList;

    @ChineseDescription("新闻相关文件列表")
    private List<Long> fileIdList;

}