package cn.com.qmth.stmms.biz.basic.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import cn.com.qmth.stmms.common.enums.PrivilegeType;

@Entity
@Table(name = "b_privilege")
public class Privilege implements Serializable {

    private static final long serialVersionUID = -6288949236298877031L;
    public static final String rootCode="root_code";
    /**
     * 主键
     */
    @Id
    @GeneratedValue
    private Integer id;
    /**
     * 权限码
     */
    @Column(name = "code",nullable = false)
    private String code;

    /**
     * 权限名称
     */
    @Column(name = "name",nullable = false)
    private String name;

    /**
     * 父权限code
     */
    @Column(name = "parent_code",nullable = false)
    private String parentCode;

    /**
     * 排序
     */
    @Column(name = "seq",nullable = false)
    private Integer seq;

    @Enumerated(EnumType.STRING)
    @Column(name = "privilege_type",nullable = false)
    private PrivilegeType privilegeType;

    /**
     * 权限访问路径
     */
    @Column(name = "privilege_uri",nullable = true)
    private String privilegeUri;
    
    /**
     * 节点层级，一级以1开始
     */
    @Column(name = "level",nullable = false)
    private Integer level;
    
    @Column(name = "icon",nullable = true)
    private String icon;
    
    @Column(name = "i18n",nullable = true)
    private String i18n;
    

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public PrivilegeType getPrivilegeType() {
		return privilegeType;
	}

	public void setPrivilegeType(PrivilegeType privilegeType) {
		this.privilegeType = privilegeType;
	}

	public String getPrivilegeUri() {
		return privilegeUri;
	}

	public void setPrivilegeUri(String privilegeUri) {
		this.privilegeUri = privilegeUri;
	}

	public String getParentCode() {
		return parentCode;
	}

	public void setParentCode(String parentCode) {
		this.parentCode = parentCode;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getI18n() {
		return i18n;
	}

	public void setI18n(String i18n) {
		this.i18n = i18n;
	}


}
