Browse Source

appId筛选

master
nili 8 months ago
parent
commit
f1f5bbf4d9
  1. 13
      game-service/src/main/java/awesome/group/game/service/AdminService.java
  2. 1
      game-service/src/main/java/awesome/group/game/service/bo/AdvRecordQuery.java
  3. 10
      game-web/src/main/java/awesome/group/rest/matrix/AdminController.java

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

@ -8,7 +8,6 @@ import awesome.group.game.dao.mapper.MatrixAdvRecordMapper;
import awesome.group.game.dao.mapper.MatrixAppMapper; import awesome.group.game.dao.mapper.MatrixAppMapper;
import awesome.group.game.service.bo.AdvRecordQuery; import awesome.group.game.service.bo.AdvRecordQuery;
import awesome.group.game.service.bo.MatrixAdvRecordBo; import awesome.group.game.service.bo.MatrixAdvRecordBo;
import awesome.group.game.service.bo.PageParam;
import awesome.group.game.service.bo.PageResult; import awesome.group.game.service.bo.PageResult;
import awesome.group.game.service.common.exception.PaganiException; import awesome.group.game.service.common.exception.PaganiException;
import awesome.group.game.service.common.exception.PaganiExceptionCode; import awesome.group.game.service.common.exception.PaganiExceptionCode;
@ -69,6 +68,9 @@ public class AdminService {
if (param.platform != null) { if (param.platform != null) {
wrapper.eq(MatrixAdvRecord::getPlatform, param.platform); wrapper.eq(MatrixAdvRecord::getPlatform, param.platform);
} }
if (param.appId != null) {
wrapper.eq(MatrixAdvRecord::getAppId, param.appId);
}
if (StringUtils.hasText(param.deviceId)) { if (StringUtils.hasText(param.deviceId)) {
wrapper.eq(MatrixAdvRecord::getDeviceId, param.deviceId); wrapper.eq(MatrixAdvRecord::getDeviceId, param.deviceId);
} }
@ -103,4 +105,13 @@ public class AdminService {
}).toList(); }).toList();
return res; return res;
} }
public List<MatrixApp> appList(Integer adminId) {
if (adminId == 1) {
return appMapper.selectList(null);
}
LambdaQueryWrapper<MatrixApp> query = Wrappers.lambdaQuery();
query.eq(MatrixApp::getOwnerId, adminId);
return appMapper.selectList(query);
}
} }

1
game-service/src/main/java/awesome/group/game/service/bo/AdvRecordQuery.java

@ -6,5 +6,6 @@ public class AdvRecordQuery extends PageParam {
public Integer advType = 3;//默认展示激励视频 public Integer advType = 3;//默认展示激励视频
public Integer platform; public Integer platform;
public String deviceId; public String deviceId;
public Integer appId;
public List<String> createdAt; public List<String> createdAt;
} }

10
game-web/src/main/java/awesome/group/rest/matrix/AdminController.java

@ -3,6 +3,7 @@ package awesome.group.rest.matrix;
import awesome.group.RequestContext; import awesome.group.RequestContext;
import awesome.group.aop.RestApi; import awesome.group.aop.RestApi;
import awesome.group.game.dao.bean.MatrixAdmin; import awesome.group.game.dao.bean.MatrixAdmin;
import awesome.group.game.dao.bean.MatrixApp;
import awesome.group.game.service.AdminService; import awesome.group.game.service.AdminService;
import awesome.group.game.service.bo.*; import awesome.group.game.service.bo.*;
import awesome.group.game.service.common.response.R; import awesome.group.game.service.common.response.R;
@ -12,6 +13,8 @@ import jakarta.annotation.Resource;
import jakarta.servlet.http.Cookie; import jakarta.servlet.http.Cookie;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController @RestController
@RequestMapping("/api/admin") @RequestMapping("/api/admin")
@Tag(name = "admin") @Tag(name = "admin")
@ -43,4 +46,11 @@ public class AdminController {
PageResult<MatrixAdvRecordBo> data = adminService.advList(query, RequestContext.getAdminID()); PageResult<MatrixAdvRecordBo> data = adminService.advList(query, RequestContext.getAdminID());
return new R<>(R.CODE_SUCCESS, "ok", data); return new R<>(R.CODE_SUCCESS, "ok", data);
} }
@GetMapping("/appList")
@RestApi
public R<List<MatrixApp>> appList() {
List<MatrixApp> data = adminService.appList(RequestContext.getAdminID());
return new R<>(R.CODE_SUCCESS, "ok", data);
}
} }

Loading…
Cancel
Save