package com.backendsys.modules.material.entity;

import com.backendsys.entity.validator.RangeArray;
import com.backendsys.entity.validator.RangeStringArray;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

@Data
@TableName("ai_material_category")
public class MaterialCategory {

    public static interface CategoryList{}
    public static interface Detail{}
    public static interface Create{}
    public static interface Update{}
    public static interface Delete{}

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("id")
    @NotNull(message="分类ID不能为空", groups = { Detail.class, Update.class, Delete.class })
    private Long category_id;

    @NotNull(message="风格ID不能为空", groups = { CategoryList.class, Detail.class })
    private Long lora_id;

    @RangeArray(message="是否共享取值有误，范围应是(-1否, 1是)", value = { "-1", "1" }, groups = { Create.class, Update.class })
    private Integer is_share;

    private Integer is_enable_feedback;

    @TableField(exist = false)
    private String lora_name;

    @Size(max = 100, message = "分类名称长度不超过 {max} 个字符", groups = { Create.class, Update.class })
    @NotEmpty(message="分类名称不能为空", groups = { Create.class, Update.class })
    private String category_name;

    @Range(min = 1, max = 9999, message = "排序必须在 {min} 到 {max} 之间")
    private Integer sort;

}
