package com.backendsys.modules.cms.navigation.entity;


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

import java.util.List;

@Data
@TableName("cms_navigation")
public class Navigation {

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

    @TableField(exist = false)
    private String lang;
    @TableId(type = IdType.AUTO)
    private Long id;

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

    @TableField(exist = false)
    @NotNull(message="navigation_id 不能为空", groups = { DeleteBatch.class })
    private List<Long> navigation_ids;

    @TableField(exist = false)
    private String navigation_name;

    @TableField(exist = false)
    private List<NavigationI18n> translations;

    private Long parent_id;

    @TableField(insertStrategy = FieldStrategy.DEFAULT)
    @Range(min = 1, max = 9999, message = "排序必须在 {min} 到 {max} 之间", groups = { Create.class, Update.class })
    private Integer sort;
    @RangeArray(message="是否跳转新窗口取值有误，范围应是(-1禁用, 1启用)", value = {"-1", "1"}, groups = { Create.class, Update.class })
    private Integer is_blank;

}
