init
This commit is contained in:
27
ruoyi-xq/src/main/java/com/ruoyi/xq/util/ShowAvatarUtil.java
Normal file
27
ruoyi-xq/src/main/java/com/ruoyi/xq/util/ShowAvatarUtil.java
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user