邮箱-后台-封禁

This commit is contained in:
khalil
2025-03-17 17:48:51 +08:00
parent 911dd86a56
commit 73ef2d241f
4 changed files with 18 additions and 11 deletions

View File

@@ -41,9 +41,8 @@ public class AccountBlockAdminService extends BaseService {
* @return
*/
public IPage<AccountBlock> getAccountBlockList(Integer pageSize, Integer pageNum, Integer type, String blockValue) {
Date now = new Date();
QueryWrapper<AccountBlock> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(type != null && type.intValue() > 0, AccountBlock::getBlockType,type)
wrapper.lambda().eq(type != null && type > 0, AccountBlock::getBlockType,type)
.like(StringUtils.isNotBlank(blockValue),AccountBlock::getBlockValue,blockValue)
// .eq(AccountBlock::getBlockStatus,BlockStatusEnum.BLOCKING.getValue())
// .le(AccountBlock::getBlockStartTime,now)

View File

@@ -79,6 +79,19 @@ public class UsersBaseService extends BaseService {
return usersList.get(0);
}
public Users getUsersByEmail(String email) {
if (StringUtils.isBlank(email)) {
return null;
}
UsersExample example = new UsersExample();
example.createCriteria().andEmailEqualTo(email);
List<Users> usersList = usersMapper.selectByExample(example);
if (CollectionUtils.isEmpty(usersList)) {
return null;
}
return usersList.get(0);
}
public List<String> getUidByErbanNo(List<String> erbanNos) {
List<String> uids = getUidByErbanNoFromCache(erbanNos);
// 如果传入的66列表大小与获取的uid结果大小不匹配.则从数据库查询
@@ -242,13 +255,6 @@ public class UsersBaseService extends BaseService {
}
}
public List<Users> getUsersByRobot(Byte sexType) {
UsersExample example = new UsersExample();
example.createCriteria().andDefUserEqualTo(Constant.usersType.robotAccount).andGenderEqualTo(sexType);
List<Users> usersList = usersMapper.selectByExample(example);
return usersList;
}
/* 绑定手机 */
public void boundPhone(Long uid, String phone, String phoneAreaCode) {
UsersExample usersExample = new UsersExample();

View File

@@ -19,7 +19,7 @@ public enum BlockTypeEnum {
BLOCK_DEVICE(3,"封禁设备","用户设备异常,请联系官方客服"),
BLOCK_IP(4,"封禁IP","用户IP异常请联系官方客服"),
BLOCK_MUTE(5,"禁言",""),
BLOCK_EMAIL(2, "封禁邮箱号","用户邮箱号异常,请联系官方客服"),
BLOCK_EMAIL(6, "封禁邮箱号","用户邮箱号异常,请联系官方客服"),
;
BlockTypeEnum(int value, String desc, String blockDesc){

View File

@@ -94,7 +94,9 @@ public class AccountBlockService extends ServiceImpl<AccountBlockMapper,AccountB
users = usersBaseService.getUsersByErBanNo(Long.parseLong(accountBlock.getBlockValue()));
}else if(accountBlock.getBlockType() == BlockTypeEnum.BLOCK_PHONE.getValue()){
users = usersBaseService.getUsersByPhone(accountBlock.getBlockValue());
}else if(accountBlock.getBlockType() == BlockTypeEnum.BLOCK_DEVICE.getValue()){
} else if (accountBlock.getBlockType() == BlockTypeEnum.BLOCK_EMAIL.getValue()) {
users = usersBaseService.getUsersByEmail(accountBlock.getBlockValue());
} else if(accountBlock.getBlockType() == BlockTypeEnum.BLOCK_DEVICE.getValue()){
AccountLoginRecord accountLoginRecord =
accountLoginRecordService.getLastLoginRecordByDevice(accountBlock.getBlockValue());
if (accountLoginRecord != null) {