package com.chushang.datascope.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Set;

/**
 * 数据权限临时表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DataScopeEntity{

    private Long roleId;

    private Long deptId;

    private Long userId;

    private String scope;

    private Set<String> permissions;
    /**
     * 用于权限控制 -- 部门及以下
     * DATA_SCOPE_DEPT_AND_CHILD
     * SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors )
     *
     * DATA_SCOPE_CUSTOM
     * SELECT dept_id FROM sys_role_dept WHERE role_id = {}
     */
    private Set<String> deptIds;

}
