package com.example.demo.model;

import io.swagger.v3.oas.annotations.media.Schema;

/**
 * 权限实体。
 * <p>对应数据库 permission 表，定义系统功能权限点。</p>
 */
@Schema(description = "权限实体")
public class Permission {

    @Schema(description = "权限ID", example = "1")
    private Long permissionId;

    @Schema(description = "权限名称", example = "用户新增")
    private String permissionName;

    @Schema(description = "权限编码", example = "user:add")
    private String permissionCode;

    @Schema(description = "类型：menu-菜单，button-按钮", example = "button")
    private String type;

    @Schema(description = "父级权限ID", example = "0")
    private Long parentId;

    public Permission() {}

    public Permission(Long permissionId, String permissionName, String permissionCode,
                      String type, Long parentId) {
        this.permissionId = permissionId;
        this.permissionName = permissionName;
        this.permissionCode = permissionCode;
        this.type = type;
        this.parentId = parentId;
    }

    public Long getPermissionId() { return permissionId; }
    public void setPermissionId(Long permissionId) { this.permissionId = permissionId; }
    public String getPermissionName() { return permissionName; }
    public void setPermissionName(String permissionName) { this.permissionName = permissionName; }
    public String getPermissionCode() { return permissionCode; }
    public void setPermissionCode(String permissionCode) { this.permissionCode = permissionCode; }
    public String getType() { return type; }
    public void setType(String type) { this.type = type; }
    public Long getParentId() { return parentId; }
    public void setParentId(Long parentId) { this.parentId = parentId; }
}
