From f13d4c961c5315f27f4393a96eb97583b02b47f8 Mon Sep 17 00:00:00 2001 From: nili Date: Wed, 20 Mar 2024 18:21:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=8F=9C=E5=8D=95=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../awesome/group/game/service/AdminService.java | 15 ++++++++------- .../group/game/service/bo/AdvRecordQuery.java | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/game-service/src/main/java/awesome/group/game/service/AdminService.java b/game-service/src/main/java/awesome/group/game/service/AdminService.java index 37c5d9c..14c786e 100644 --- a/game-service/src/main/java/awesome/group/game/service/AdminService.java +++ b/game-service/src/main/java/awesome/group/game/service/AdminService.java @@ -25,10 +25,7 @@ import org.springframework.util.StringUtils; import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; @Service @@ -62,15 +59,19 @@ public class AdminService { public PageResult advList(AdvRecordQuery param, int ownerId) { List appList = appMapper.selectList(null); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); + + Optional app = appList.stream().filter(x -> x.getCode().equals(param.code)).findFirst(); + if (app.isEmpty()) { + throw new PaganiException(PaganiExceptionCode.ILLEGAL_REQUEST, "非法请求"); + } + wrapper.eq(MatrixAdvRecord::getAppId, app.get().getId()); + if (param.advType != null) { wrapper.eq(MatrixAdvRecord::getAdvType, param.advType); } if (param.platform != null) { wrapper.eq(MatrixAdvRecord::getPlatform, param.platform); } - if (param.appId != null) { - wrapper.eq(MatrixAdvRecord::getAppId, param.appId); - } if (StringUtils.hasText(param.deviceId)) { wrapper.eq(MatrixAdvRecord::getDeviceId, param.deviceId); } diff --git a/game-service/src/main/java/awesome/group/game/service/bo/AdvRecordQuery.java b/game-service/src/main/java/awesome/group/game/service/bo/AdvRecordQuery.java index d78e879..b9f2949 100644 --- a/game-service/src/main/java/awesome/group/game/service/bo/AdvRecordQuery.java +++ b/game-service/src/main/java/awesome/group/game/service/bo/AdvRecordQuery.java @@ -6,6 +6,6 @@ public class AdvRecordQuery extends PageParam { public Integer advType = 3;//默认展示激励视频 public Integer platform; public String deviceId; - public Integer appId; + public String code; public List createdAt; }