pom-mybatisPlus-升级

This commit is contained in:
khalil
2024-12-04 15:01:00 +08:00
parent f221223128
commit 5a51676b44
124 changed files with 311 additions and 639 deletions

View File

@@ -183,12 +183,12 @@ public class AccountManageService {
RepeatedDeviceIpRegisterLimitConfig repeatedConfig = getRepeatedDeviceIpLimitConfig();
if (repeatedConfig.isOpen()) {
int repeatedDeviceNum = accountService.lambdaQuery().eq(Account::getDeviceId, deviceId).count();
long repeatedDeviceNum = accountService.lambdaQuery().eq(Account::getDeviceId, deviceId).count();
if (repeatedDeviceNum >= repeatedConfig.getRepeatedDeviceNumLimit()) {
throw new CustomOAuth2Exception(CustomOAuth2Exception.SIGN_IP_TO_OFTEN, BusiStatus.REGISTER_FREQUENT.getReasonPhrase());
}
int repeatedIpNum = accountService.lambdaQuery().eq(Account::getRegisterIp, ipAddress).count();
long repeatedIpNum = accountService.lambdaQuery().eq(Account::getRegisterIp, ipAddress).count();
if (repeatedIpNum >= repeatedConfig.getRepeatedIpNumLimit()) {
throw new CustomOAuth2Exception(CustomOAuth2Exception.SIGN_IP_TO_OFTEN, BusiStatus.REGISTER_FREQUENT.getReasonPhrase());
}
@@ -197,7 +197,7 @@ public class AccountManageService {
//当日单个ip注册数
DayIpMaxRegisterLimitConfig config = getIpMaxLimitConfig();
if (config.getOpen()) {
int count = accountService.getRegisterIpCountByOneDay(ipAddress);
long count = accountService.getRegisterIpCountByOneDay(ipAddress);
if (count >= config.getMax()) {
throw new CustomOAuth2Exception(CustomOAuth2Exception.SIGN_IP_TO_OFTEN, BusiStatus.REGISTER_FREQUENT.getReasonPhrase());
}
@@ -311,8 +311,8 @@ public class AccountManageService {
}
}
int count = accountService.countByPhone(phone);
if (count > 1) {
long count = accountService.countByPhone(phone);
if (count > 1L) {
throw new ServiceException(BusiStatus.PHONE_BIND_TOO_MANY_ACCOUNT);
}

View File

@@ -150,8 +150,8 @@ public class TicketServices implements InitializingBean {
public void saveLoginRecord(Long uid, String ipAddress, DeviceInfo deviceInfo) {
Optional.ofNullable(uid).ifPresent(id -> {
userAppService.updateCurrentApp(uid, deviceInfo.getApp(), new Date(), ipAddress, deviceInfo.getAppVersion());
int count = loginRecordService.countLoginRecordToday(id);
if (count == 0) {
long count = loginRecordService.countLoginRecordToday(id);
if (count <= 0L) {
Account account = accountService.getById(id);
Optional.ofNullable(account).ifPresent(acc -> {
AccountLoginRecord record = myUserDetailsService.buildAccountLoginRecord(ipAddress, acc, LoginTypeEnum.TICKET.getValue(), deviceInfo, null);