h5-recharge-login
This commit is contained in:
@@ -76,4 +76,6 @@ public interface UsersMapper {
|
||||
|
||||
|
||||
List<Users> listUid(@Param("start") Integer start, @Param("len") Integer len);
|
||||
|
||||
Integer recharegeCount(@Param("uid") Long uid);
|
||||
}
|
@@ -22,7 +22,6 @@ import com.google.gson.reflect.TypeToken;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -523,4 +522,9 @@ public class UsersBaseService extends BaseService {
|
||||
deleteUserRelateCache(uid.toString());
|
||||
}
|
||||
|
||||
|
||||
public Integer rechargeUserCount(Long uid) {
|
||||
return usersMapper.recharegeCount(uid);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1082,4 +1082,8 @@
|
||||
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
|
||||
select uid, partition_id partitionId from users order by uid asc limit #{start},#{len}
|
||||
</select>
|
||||
|
||||
<select id="recharegeCount" resultType="java.lang.Integer">
|
||||
select ifnull(count(1),0) from recharge_user where uid = #{uid}
|
||||
</select>
|
||||
</mapper>
|
@@ -990,6 +990,7 @@ public enum BusiStatus {
|
||||
ROOM_DAY_DIAMOND_REWARD_DATE_CHECK(500, "TODAY NOT ALLOW RECEIVE"),
|
||||
GUILD_USD_OPT_LIMIT(500, "该交易类型已达到本周交易次数上限"),
|
||||
GUILD_MEMBER_REMOVE_LIMIT(500, "仅在每个月1号、2号、3号才可以移除主播"),
|
||||
H5_RECHARGE_USER_NOT_OPEN(1404, "Your account has not enabled this function yet, so it cannot be used."),
|
||||
;
|
||||
|
||||
private final int value;
|
||||
|
@@ -3,6 +3,7 @@ package com.accompany.oauth2.service.account;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.base.SpringContextHolder;
|
||||
import com.accompany.core.enumeration.PartitionEnum;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.mybatismapper.AccountLoginRecordMapperExpand;
|
||||
@@ -60,7 +61,13 @@ public class AccountH5LoginService {
|
||||
if (null == u){
|
||||
throw new ServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
// PartitionUtil.checkInPartition(4, u.getPartitionId());
|
||||
|
||||
if (u.getPartitionId() != PartitionEnum.CHINESE.getId()) {
|
||||
Integer userCount = usersBaseService.rechargeUserCount(uid);
|
||||
if (userCount <= 0) {
|
||||
throw new ServiceException(BusiStatus.H5_RECHARGE_USER_NOT_OPEN);
|
||||
}
|
||||
}
|
||||
|
||||
String jwtToken = createJwtToken(uid);
|
||||
saveH5LoginJwtToken(uid, jwtToken);
|
||||
|
Reference in New Issue
Block a user