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; }