package com.backendsys.entity.Med;

import com.backendsys.entity.validator.RangeArray;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.util.List;

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

    /**
     * med_material
     */

    private Long id;

    @NotNull(message="material_id 不能为空", groups = { MedMaterialDTO.Detail.class, MedMaterialDTO.Update.class, MedMaterialDTO.Audit.class })
    private Long material_id;

    private List<Long> material_ids;

    @NotNull(message="素材分类ID不能为空", groups = {MedMaterialDTO.Create.class, MedMaterialDTO.Update.class })
    private Long category_id;
    private String category_name; // 简易写法

    @Size(max = 100, message = "素材标题长度不超过 {max} 字符")
    @NotEmpty(message="素材标题不能为空", groups = {MedMaterialDTO.Create.class, MedMaterialDTO.Update.class })
    private String title;

    @Size(max = 200, message = "素材描述长度不超过 {max} 字符", groups = {MedMaterialDTO.Create.class, MedMaterialDTO.Update.class })
    private String description;

    @Size(max = 10000, message = "素材内容长度不超过 {max} 字符", groups = {MedMaterialDTO.Create.class, MedMaterialDTO.Update.class })
    private String content;

    @Size(max = 500, message = "缩略图路径长度不超过 {max} 字符", groups = {MedMaterialDTO.Create.class, MedMaterialDTO.Update.class})
    private String thumb;

    @RangeArray(message="素材类型取值有误，范围应是(1图片, 2视频, 3音频, 4文案)", value = {"1", "2", "3", "4"}, groups = { MedMaterialDTO.Create.class })
    private Integer material_type;
    @Size(max = 500, message = "文件路径长度不超过 {max} 字符", groups = {MedMaterialDTO.Create.class, MedMaterialDTO.Update.class})
    private String file;

    @RangeArray(message="素材状态取值有误，范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = {MedMaterialDTO.Create.class, MedMaterialDTO.Update.class})
    private Integer status;

    @RangeArray(message="审核状态取值有误，范围应是(-1审核拒绝, 1待审核, 2审核通过)", value = {"-1", "1", "2"}, groups = { MedMaterialDTO.Audit.class })
    private Integer audit_status;
    @Size(max = 1000, message = "审核备注长度不超过 {max} 字符", groups = { MedMaterialDTO.Audit.class })
    private String audit_note;

    @RangeArray(message="del_flag 取值有误，范围应是(-1未删除, 1删除)", value = {"-1", "1"}, groups = {MedMaterialDTO.Create.class, MedMaterialDTO.Update.class})
    private Integer del_flag;

    @RangeArray(message="是否置顶取值有误，范围应是(-1不置顶, 1置顶)", value = {"-1", "1"}, groups = {MedMaterialDTO.Create.class, MedMaterialDTO.Update.class})
    private Integer is_top;
    private String create_time;
    private String update_time;

}
