Browse Source

算数据接口

master
nili 7 months ago
parent
commit
636455685d
  1. 11
      game-service/src/main/java/awesome/group/game/service/AdminService.java
  2. 8
      game-web/src/main/java/awesome/group/game/web/rest/matrix/AdminController.java

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

@ -156,6 +156,7 @@ public class AdminService {
List<MatrixApp> appList = appList(adminId);
return appList.stream().map(MatrixAppBo::new).toList();
}
public List<MatrixApp> appList(Integer adminId) {
List<Integer> appIds = getAdminAppIds(adminId);
if (CollectionUtils.isEmpty(appIds)) {
@ -438,6 +439,16 @@ public class AdminService {
calcAppIncome();
}
@Async
public void mock(int targetStartDate, int targetEndDate) {
int date = targetStartDate;
while (date <= targetEndDate) {
calcTargetDate(date);
date = DateUtil.datePlus(date, 1);
}
calcAppIncome();
}
public void calcTargetDate(int targetDate) {
long dateBegin = DateUtil.getDayBeginTimestamp(DateUtil.date2Long(targetDate));
long dateEnd = dateBegin + 86400_000 - 1;

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

@ -106,7 +106,7 @@ public class AdminController {
@PostMapping("/addWhiteList")
@RestApi
public R<Void> addWhiteList(@RequestParam String deviceId, @RequestParam String channel){
public R<Void> addWhiteList(@RequestParam String deviceId, @RequestParam String channel) {
adminService.addWhiteList(deviceId, channel);
return new R<>(R.CODE_SUCCESS, "ok", null);
}
@ -145,6 +145,12 @@ public class AdminController {
@RestApi
public R<STSInfo> getSTS() {
return new R<>(ossService.getSTS(RequestContext.getAdminID()));
}
@GetMapping("/mock")
@RestApi
public R<Void> mock(@RequestParam Integer start, @RequestParam Integer end) {
adminService.mock(start, end);
return new R<>(R.CODE_SUCCESS, "ok", null);
}
}

Loading…
Cancel
Save