package com.backendsys.entity.Cms;

import com.backendsys.entity.validator.RangeArray;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

@Data
public class CmsBannerDTO {
    public static interface Detail{}
    public static interface Create{}
    public static interface Update{}
    public static interface Delete{}

    /**
     * cms_banner
     */
    private Long id;
    @NotNull(message="banner_id 不能为空", groups = { CmsBannerDTO.Detail.class, CmsBannerDTO.Update.class, CmsBannerDTO.Delete.class })
    private Long banner_id;
    @Size(max = 20, message = "资讯标题长度不超过 {max} 字符", groups = {CmsBannerDTO.Create.class, CmsBannerDTO.Update.class})
    @NotNull(message="幻灯片标题不能为空", groups = { CmsBannerDTO.Create.class, CmsBannerDTO.Update.class })
    private String title;
    @RangeArray(message="幻灯片类型取值有误，范围应是(1首页幻灯片, 2内页幻灯片)", value = {"1", "2"}, groups = { CmsBannerDTO.Create.class })
    private Integer type;
    @Size(max = 500, message = "链接路径长度不超过 {max} 字符", groups = {CmsBannerDTO.Create.class, CmsBannerDTO.Update.class})
    private String link;
    @Size(max = 500, message = "图片路径长度不超过 {max} 字符", groups = {CmsBannerDTO.Create.class, CmsBannerDTO.Update.class})
    @NotNull(message="图片路径不能为空", groups = { CmsBannerDTO.Create.class, CmsBannerDTO.Update.class })
    private String image;
    @Size(max = 500, message = "图片(缩略图)路径长度不超过 {max} 字符", groups = {CmsBannerDTO.Create.class, CmsBannerDTO.Update.class})
    @NotNull(message="图片(缩略图)路径不能为空", groups = { CmsBannerDTO.Create.class, CmsBannerDTO.Update.class })
    private String image_thumb;
    @Range(min = 1, max = 9999, message = "排序必须在 {min} 到 {max} 之间", groups = {CmsBannerDTO.Create.class, CmsBannerDTO.Update.class})
    private Integer sort;
    @RangeArray(message="幻灯片状态取值有误，范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = {CmsBannerDTO.Create.class, CmsBannerDTO.Update.class})
    private Integer status;

    private String create_time;
    private String update_time;

}
