|
@@ -1,6 +1,6 @@
|
|
|
package org.jeecg.modules.adweb.enquiry.controller;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -89,7 +89,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
return Result.error("IP长度不能超过15");
|
|
|
}
|
|
|
|
|
|
- int count = (int) adwebBlackIpService.count(new QueryWrapper<AdwebPublicBlackIp>().eq("ip", adwebBlackIp.getIp()).eq("status", 1));
|
|
|
+ int count = (int) adwebBlackIpService.count(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getIp, adwebBlackIp.getIp()).eq(AdwebPublicBlackIp::getStatus, 1));
|
|
|
|
|
|
if (count > 0) {
|
|
|
return Result.error("该IP已存在");
|
|
@@ -97,7 +97,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
|
|
|
adwebBlackIp.setStatus(1);
|
|
|
adwebBlackIpService.save(adwebBlackIp);
|
|
|
- List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 0));
|
|
|
+ List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(blackIpList)) {
|
|
|
List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
|
|
@@ -106,7 +106,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
adwebRedisUtil.del(BlackIpKey);
|
|
|
}
|
|
|
|
|
|
- List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 1));
|
|
|
+ List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(whiteIpList)) {
|
|
|
List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
|
|
@@ -135,7 +135,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
return Result.error("IP长度不能超过15");
|
|
|
}
|
|
|
|
|
|
- int count = (int) adwebBlackIpService.count(new QueryWrapper<AdwebPublicBlackIp>().eq("ip", adwebBlackIp.getIp()).eq("status", 1).ne("id", adwebBlackIp.getId()));
|
|
|
+ int count = (int) adwebBlackIpService.count(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getIp, adwebBlackIp.getIp()).eq(AdwebPublicBlackIp::getStatus, 1).ne(AdwebPublicBlackIp::getId, adwebBlackIp.getId()));
|
|
|
|
|
|
if (count > 0) {
|
|
|
return Result.error("该IP已存在");
|
|
@@ -143,7 +143,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
|
|
|
adwebBlackIpService.updateById(adwebBlackIp);
|
|
|
|
|
|
- List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 0));
|
|
|
+ List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(blackIpList)) {
|
|
|
List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
|
|
@@ -152,7 +152,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
adwebRedisUtil.del(BlackIpKey);
|
|
|
}
|
|
|
|
|
|
- List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 1));
|
|
|
+ List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(whiteIpList)) {
|
|
|
List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
|
|
@@ -178,7 +178,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
return Result.error("ID不能为空");
|
|
|
}
|
|
|
|
|
|
- List<AdwebPublicBlackIp> list = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("id", id).eq("status", 1));
|
|
|
+ List<AdwebPublicBlackIp> list = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getId, id).eq(AdwebPublicBlackIp::getStatus, 1));
|
|
|
|
|
|
if (list.size() == 0) {
|
|
|
return Result.error("该IP不存在");
|
|
@@ -193,7 +193,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
adwebRedisUtil.del(IpOneDayKey + adwebBlackIp.getIp());
|
|
|
adwebRedisUtil.del(NotBlackIpWasteEnquiryKey + adwebBlackIp.getIp());
|
|
|
|
|
|
- List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 0));
|
|
|
+ List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(blackIpList)) {
|
|
|
List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
|
|
@@ -202,7 +202,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
adwebRedisUtil.del(BlackIpKey);
|
|
|
}
|
|
|
|
|
|
- List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 1));
|
|
|
+ List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(whiteIpList)) {
|
|
|
List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
|
|
@@ -230,7 +230,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
}
|
|
|
List<String> idList = Arrays.asList(ids.split(","));
|
|
|
|
|
|
- List<AdwebPublicBlackIp> list = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).in("id", idList));
|
|
|
+ List<AdwebPublicBlackIp> list = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).in(AdwebPublicBlackIp::getId, idList));
|
|
|
|
|
|
if (list.size() == 0) {
|
|
|
return Result.error("该IP不存在");
|
|
@@ -244,7 +244,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
adwebRedisUtil.del(NotBlackIpWasteEnquiryKey + adwebBlackIp.getIp());
|
|
|
}
|
|
|
|
|
|
- List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 0));
|
|
|
+ List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(blackIpList)) {
|
|
|
List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
|
|
@@ -253,7 +253,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
adwebRedisUtil.del(BlackIpKey);
|
|
|
}
|
|
|
|
|
|
- List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 1));
|
|
|
+ List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(whiteIpList)) {
|
|
|
List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
|
|
@@ -281,7 +281,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
|
|
|
return Result.error("ID不能为空");
|
|
|
}
|
|
|
|
|
|
- List<AdwebPublicBlackIp> list = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("id", id).eq("status", 1));
|
|
|
+ List<AdwebPublicBlackIp> list = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getId, id).eq(AdwebPublicBlackIp::getStatus, 1));
|
|
|
|
|
|
if (list.size() == 0) {
|
|
|
return Result.error("该IP不存在");
|