Browse Source

动态菜单栏

master
nili 9 months ago
parent
commit
f13d4c961c
  1. 15
      game-service/src/main/java/awesome/group/game/service/AdminService.java
  2. 2
      game-service/src/main/java/awesome/group/game/service/bo/AdvRecordQuery.java

15
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<MatrixAdvRecordBo> advList(AdvRecordQuery param, int ownerId) {
List<MatrixApp> appList = appMapper.selectList(null);
LambdaQueryWrapper<MatrixAdvRecord> wrapper = Wrappers.lambdaQuery();
Optional<MatrixApp> 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);
}

2
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<String> createdAt;
}

Loading…
Cancel
Save