package cd.casic.framework.datapermission.service.permission.menu;

import cd.casic.framework.commons.enums.CommonStatusEnum;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author songqiang
 * @date 2023-11-08 11:40
 * @description
 */
@Schema(description = "管理后台 - 菜单树 Response VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class MenuTreeVO {

    @Schema(description = "菜单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Long id;

    @Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
    private String name;

    @Schema(description = "父菜单 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    private Long parentId;

    @Schema(description = "类型,参见 MenuTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Integer type;

    @Schema(description = "路由地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "/system")
    private String path;

    @Schema(description = "菜单图标", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "system")
    private String icon;

    @Schema(description = "组件路径", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "system/user/index")
    private String component;

    @Schema(description = "组件名", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "SystemUser")
    private String componentName;

    @Schema(description = "子菜单", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private List<MenuTreeVO> child;


    /**
     * 目录分组
     */
    private String menuGroup;
    /**
     * 目录重定向
     */
    private String redirect;
    /**
     * 状态
     *
     * 枚举 {@link CommonStatusEnum}
     */
    private Integer status;
    /**
     * 是否可见
     *
     * 只有菜单、目录使用
     * 当设置为 true 时，该菜单不会展示在侧边栏，但是路由还是存在。例如说，一些独立的编辑页面 /edit/1024 等等
     */
    private Boolean visible;
    /**
     * 是否缓存
     *
     * 只有菜单、目录使用，否使用 Vue 路由的 keep-alive 特性
     * 注意：如果开启缓存，则必须填写 {@link #componentName} 属性，否则无法缓存
     */
    private Boolean keepAlive;
    /**
     * 是否总是显示
     *
     * 如果为 false 时，当该菜单只有一个子菜单时，不展示自己，直接展示子菜单
     */
    private Boolean alwaysShow;
    /**
     * 是否显示子菜单
     */
    private Boolean showChildren;
    /**
     * 当前激活目录
     */
    private String currentActiveMenu;
    /**
     * 外部站点地址
     */
    private String frameSrc;


    private Boolean isTag;
    private Boolean hideBreadcrumb;
    private Boolean tagDot;
    private String tagType;
    private String tagContent;
}
