package com.cpop.system.business.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 系统菜单表Vo输出
 *
 * @author DB.lost
 * @since 2023-05-10
 */
@Data
@Accessors(chain = true)
@Schema(description = "菜单返回对象")
public class MenuVo {

    /**
     * 菜单ID
     */
    @Schema(description = "菜单ID")
    private String id;

    /**
     * 父级菜单ID
     */
    @Schema(description = "父级菜单ID")
    private String parentMenu;

    /**
     * 菜单名称
     */
    @Schema(description = "菜单名称")
    private String name;

    /**
     * 菜单图标
     */
    @Schema(description = "菜单图标")
    private String icon;

    /**
     * 菜单路由，父菜单为空
     */
    @Schema(description = "菜单路由，父菜单为空")
    private String component;

    /**
     * 标记菜单的状态 0:禁用 1:启用（根据权限正常显示）
     */
    @Schema(description = "标记菜单的状态 0:禁用 1:启用（根据权限正常显示）")
    private Boolean status;

    /**
     * 权限
     */
    @Schema(description = "权限")
    private String permission;

    /**
     * 重定向路径，一级菜单有值
     */
    @Schema(description = "重定向路径，一级菜单有值")
    private String redirect;

    /**
     * 排序，值越小越靠前，一级菜单有值
     */
    @Schema(description = "排序，值越小越靠前，一级菜单有值")
    private Integer orderNo;

    /**
     * 路由地址
     */
    @Schema(description = "路由地址")
    private String path;

    /**
     * 标题
     */
    @Schema(description = "标题")
    private String title;

    /**
     * 子菜单集
     */
    @Schema(description = "子菜单集")
    private List<MenuVo> children;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 菜单类型，0:目录，1:菜单，2:按钮
     */
    @Schema(description = "菜单类型，0:目录，1:菜单，2:按钮")
    private Integer type;

    /**
     * 隐藏菜单
     */
    @Schema(description = "隐藏菜单")
    private Boolean hideMenu;

    /**
     * 是否忽略KeepAlive缓存
     */
    @Schema(description = "是否忽略KeepAlive缓存")
    private Boolean ignoreKeepAlive;

}
