package com.ruoyi.xq.util;

public class ShowAvatarUtil {

    /**
     * 判断用户是可以查看头像
     * @param showAvatar 1-所有用户 2-VIP用户 3-实名用户 4-实名认证且VIP用户 5-不公开
     */
    public static boolean showAvatar(boolean vip, boolean cardAuth, Integer showAvatar) {
        if(showAvatar == null){
            return true;
        }
        if(showAvatar == 1){
            return true;
        }
        if(showAvatar == 2){
            return vip;
        }
        if(showAvatar == 3){
            return cardAuth;
        }
        if(showAvatar == 4){
            return vip && cardAuth;
        }
        return false;
    }
}
