Browse Source

广告详情加口子

master
nili 7 months ago
parent
commit
bb87184898
  1. 5
      game-service/src/main/java/awesome/group/game/service/AdminService.java
  2. 2
      game-service/src/main/java/awesome/group/game/service/bo/MatrixAdvRecordBo.java

5
game-service/src/main/java/awesome/group/game/service/AdminService.java

@ -130,10 +130,15 @@ public class AdminService {
wrapper.orderByDesc("id"); wrapper.orderByDesc("id");
IPage<MatrixAdvRecord> iPage = advRecordMapper.selectPage(new Page<>(page, pageSize), wrapper); IPage<MatrixAdvRecord> iPage = advRecordMapper.selectPage(new Page<>(page, pageSize), wrapper);
Map<Integer, MatrixApp> appMap = appList.stream().collect(Collectors.toMap(MatrixApp::getId, x -> x)); Map<Integer, MatrixApp> appMap = appList.stream().collect(Collectors.toMap(MatrixApp::getId, x -> x));
List<MatrixAdmin> adminList = adminMapper.selectList(null);
Map<Integer, String> adminMap = adminList.stream().collect(Collectors.toMap(MatrixAdmin::getId, MatrixAdmin::getName));
res.total = iPage.getTotal(); res.total = iPage.getTotal();
res.data = iPage.getRecords().stream().map(x -> { res.data = iPage.getRecords().stream().map(x -> {
MatrixAdvRecordBo bo = new MatrixAdvRecordBo(x, appMap.get(x.getAppId())); MatrixAdvRecordBo bo = new MatrixAdvRecordBo(x, appMap.get(x.getAppId()));
BeanUtils.copyProperties(x, bo); BeanUtils.copyProperties(x, bo);
if (x.getAdminId() != null) {
bo.adminName = adminMap.get(x.getAdminId());
}
return bo; return bo;
}).toList(); }).toList();
return res; return res;

2
game-service/src/main/java/awesome/group/game/service/bo/MatrixAdvRecordBo.java

@ -9,6 +9,8 @@ public class MatrixAdvRecordBo extends MatrixAdvRecordEditBo {
public long createdAt; public long createdAt;
public Integer id; public Integer id;
public String adminName;
public MatrixAdvRecordBo(MatrixAdvRecord r, MatrixApp app) { public MatrixAdvRecordBo(MatrixAdvRecord r, MatrixApp app) {
this.advType = r.getAdvType(); this.advType = r.getAdvType();
this.deviceId = r.getDeviceId(); this.deviceId = r.getDeviceId();

Loading…
Cancel
Save