package com.hz.pm.api.datascope.provider.impl;

import com.hz.pm.api.datascope.model.DataScopeDTO;
import com.hz.pm.api.datascope.provider.DataScopeProvider;
import com.hz.pm.api.user.model.enumeration.RoleEnum;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Optional;

/**
 * <p>
 * 数据权限 访客
 * </p>
 *
 * @author ZPF
 * @since 2023/3/27 23:29
 */
@Slf4j
@RequiredArgsConstructor
@Component("VISITOR")
public class VisitorDataScopeProviderImpl implements DataScopeProvider {

    @Override
    public Optional<DataScopeDTO> findDataFieldProperty() {
        DataScopeDTO ds = new DataScopeDTO();
        ds.setRole(RoleEnum.SUPER_ADMIN);
        return Optional.of(ds);
    }

    @Override
    public Optional<DataScopeDTO> findDataFieldProperty(Long userId) {
        DataScopeDTO ds = new DataScopeDTO();
        ds.setRole(RoleEnum.SUPER_ADMIN);
        return Optional.of(ds);
    }
}
