package com.xunhong.erp.turbo.rbac.infrastructure.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.xunhong.erp.turbo.api.rbac.dto.enums.MenuTypeEnum;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * @author shenyifei
 */
@Data
@TableName(value = "menu")
@EqualsAndHashCode(callSuper = true)
public class MenuDO extends BaseDO<MenuDO> {

	/**
	 * 菜单id
	 */
	@TableId(value = "menu_id", type = IdType.ASSIGN_ID)
	private Long menuId;
	/**
	 * 平台id
	 */
	@TableField(value = "platform_id")
	private Long platformId;
	/**
	 * 名称
	 */
	@TableField(value = "name")
	private String name;
	/**
	 * 路径
	 */
	@TableField(value = "path")
	private String path;
	/**
	 * 组件
	 */
	@TableField(value = "component")
	private String component;
	/**
	 * 上级菜单id
	 */
	@TableField(value = "pid")
	private Long pid;
	/**
	 * 菜单类型：1：菜单，2：页面，3：按钮
	 */
	@TableField(value = "type")
	private MenuTypeEnum type;
	/**
	 * 菜单排序
	 */
	@TableField(value = "sort")
	private BigDecimal sort;
	/**
	 * display
	 */
	@TableField(value = "hide_in_menu")
	private Boolean hideInMenu;
	/**
	 * 权限id
	 */
	@TableField(value = "permission_id", updateStrategy = FieldStrategy.ALWAYS)
	private Long permissionId;

	/**
	 * 菜单图标
	 */
	@TableField(value = "icon")
	private String icon;

	/**
	 * 图标颜色
	 */
	@TableField(value = "icon_color")
	private String iconColor;

	/**
	 * 背景颜色类名
	 */
	@TableField(value = "bg_color_class")
	private String bgColorClass;

	@TableField(exist = false)
	private PermissionDO permissionDO;
}
