package com.zsc.edu.gateway.modules.system.entity;


import com.baomidou.mybatisplus.annotation.IEnum;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zsc.edu.gateway.common.enums.IState;
import lombok.*;

/**
 * 操作权限
 *
 * @author harry yao
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("sys_menu")
public class Menu extends BaseEntity {

    private Long pid;
    private Type type;
    private String name;
    private String path;
    private String locale;
    private String icon;
    private Boolean requiresAuth;
    private Boolean hideInMenu;
    private Integer menuOrder;
    private String permissions;
    private String authority;

    public enum Type implements IEnum<Integer>, IState<Type> {
        /**
         * 页面
         */
        PAGE(1, "页面"),
        /**
         * 操作
         */
        OPERATION(2, "操作");

        private final Integer value;
        private final String description;

        Type(int value, String description) {
            this.value = value;
            this.description = description;
        }

        @Override
        public Integer getValue() {
            return this.value;
        }

        @Override
        public String toString() {
            return this.description;
        }
    }

}
