This commit is contained in:
张良(004796)
2024-03-29 14:45:29 +08:00
parent e3bf8cd433
commit fbec1e6a56
15 changed files with 316 additions and 42 deletions

View File

@@ -0,0 +1,27 @@
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;
}
}