package com.sikey.wa04.common.utils;

import com.sikey.wa04.common.enums.IdentityEnum;
import lombok.experimental.UtilityClass;

/**
 * @Author: nelson
 * @Date: 2025/6/17
 * @Description: 用户
 */
@UtilityClass
public class UserUtil {
    /**
     * 是否成员
     *
     * @param identityEnum
     * @return
     */
    public boolean isFamilyMembers(IdentityEnum identityEnum) {
        return switch (identityEnum) {
            case IDENTITY_ADMIN, IDENTITY_SUPER_ADMIN, IDENTITY_FAMILY -> true;
            default -> false;
        };
    }

    /**
     * 是否管理员
     *
     * @param identityEnum
     * @return
     */
    public boolean isIdentityAdmin(IdentityEnum identityEnum) {
        return switch (identityEnum) {
            case IDENTITY_ADMIN, IDENTITY_SUPER_ADMIN -> true;
            default -> false;
        };
    }

}
