h5-recharge-login

This commit is contained in:
2025-10-14 15:19:22 +08:00
parent b4a3e3f37a
commit bccd82f021
5 changed files with 20 additions and 2 deletions

View File

@@ -76,4 +76,6 @@ public interface UsersMapper {
List<Users> listUid(@Param("start") Integer start, @Param("len") Integer len); List<Users> listUid(@Param("start") Integer start, @Param("len") Integer len);
Integer recharegeCount(@Param("uid") Long uid);
} }

View File

@@ -22,7 +22,6 @@ import com.google.gson.reflect.TypeToken;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@@ -523,4 +522,9 @@ public class UsersBaseService extends BaseService {
deleteUserRelateCache(uid.toString()); deleteUserRelateCache(uid.toString());
} }
public Integer rechargeUserCount(Long uid) {
return usersMapper.recharegeCount(uid);
}
} }

View File

@@ -1082,4 +1082,8 @@
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */ /* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
select uid, partition_id partitionId from users order by uid asc limit #{start},#{len} select uid, partition_id partitionId from users order by uid asc limit #{start},#{len}
</select> </select>
<select id="recharegeCount" resultType="java.lang.Integer">
select ifnull(count(1),0) from recharge_user where uid = #{uid}
</select>
</mapper> </mapper>

View File

@@ -990,6 +990,7 @@ public enum BusiStatus {
ROOM_DAY_DIAMOND_REWARD_DATE_CHECK(500, "TODAY NOT ALLOW RECEIVE"), ROOM_DAY_DIAMOND_REWARD_DATE_CHECK(500, "TODAY NOT ALLOW RECEIVE"),
GUILD_USD_OPT_LIMIT(500, "该交易类型已达到本周交易次数上限"), GUILD_USD_OPT_LIMIT(500, "该交易类型已达到本周交易次数上限"),
GUILD_MEMBER_REMOVE_LIMIT(500, "仅在每个月1号、2号、3号才可以移除主播"), 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; private final int value;

View File

@@ -3,6 +3,7 @@ package com.accompany.oauth2.service.account;
import com.accompany.common.redis.RedisKey; import com.accompany.common.redis.RedisKey;
import com.accompany.common.status.BusiStatus; import com.accompany.common.status.BusiStatus;
import com.accompany.core.base.SpringContextHolder; import com.accompany.core.base.SpringContextHolder;
import com.accompany.core.enumeration.PartitionEnum;
import com.accompany.core.exception.ServiceException; import com.accompany.core.exception.ServiceException;
import com.accompany.core.model.Users; import com.accompany.core.model.Users;
import com.accompany.core.mybatismapper.AccountLoginRecordMapperExpand; import com.accompany.core.mybatismapper.AccountLoginRecordMapperExpand;
@@ -60,7 +61,13 @@ public class AccountH5LoginService {
if (null == u){ if (null == u){
throw new ServiceException(BusiStatus.USERNOTEXISTS); 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); String jwtToken = createJwtToken(uid);
saveH5LoginJwtToken(uid, jwtToken); saveH5LoginJwtToken(uid, jwtToken);