|
|
|
@@ -0,0 +1,37 @@ |
|
|
|
package com.iformall.utils; |
|
|
|
|
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.domain.po.WxCUser; |
|
|
|
import com.iformall.domain.po.WxCUserBasicInfo; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
/** |
|
|
|
* 用户校验工具类 |
|
|
|
*/ |
|
|
|
public class UserUtil { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 增加积分:校验用户信息 |
|
|
|
* 规则:有手机号增加积分,无手机号提示授权手机号 |
|
|
|
* @param wxCUser |
|
|
|
* @param wxCUserBasicInfo |
|
|
|
*/ |
|
|
|
public static void creditUsercheck(WxCUser wxCUser, WxCUserBasicInfo wxCUserBasicInfo) { |
|
|
|
if (Objects.isNull(wxCUser) && Objects.isNull(wxCUserBasicInfo)) { |
|
|
|
throw new MallinkException(ErrorCode.USER_NOT_MEMBER); |
|
|
|
} |
|
|
|
|
|
|
|
if (Objects.isNull(wxCUserBasicInfo)|| StringUtils.isBlank(wxCUserBasicInfo.getPhone())) { |
|
|
|
throw new MallinkException(ErrorCode.USER_NOT_AUTH_PHONE); |
|
|
|
} |
|
|
|
|
|
|
|
if (Objects.isNull(wxCUser)|| StringUtils.isBlank(wxCUser.getPhone())) { |
|
|
|
throw new MallinkException(ErrorCode.USER_NOT_AUTH_PHONE); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |