DebugController.java
1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package cn.fw.valhalla.controller.debug;
import cn.fw.common.web.annotation.ControllerMethod;
import cn.fw.data.base.domain.common.Message;
import cn.fw.security.auth.client.annotation.Authorization;
import cn.fw.security.auth.client.annotation.IgnoreAuth;
import cn.fw.security.auth.client.enums.AuthType;
import cn.fw.valhalla.common.utils.DateUtil;
import cn.fw.valhalla.service.report.PublicReportBizService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDate;
import java.util.Date;
import java.util.Objects;
import static cn.fw.common.web.util.ResultBuilder.success;
/**
* @author : kurisu
* @className : DebugController
* @description : 调试接口
* @date: 2020-10-22 11:06
*/
@Slf4j
@RestController
@RequiredArgsConstructor
@IgnoreAuth
@Authorization(AuthType.APP)
@Validated
@RequestMapping("/valhalla/debug")
public class DebugController {
private final PublicReportBizService publicReportBizService;
@GetMapping("/run/publicReportData")
@ControllerMethod("公共池报表数据准备")
public Message<Void> publicReportData(@RequestParam(required = false) Long groupId,
@RequestParam(required = false)Date date) {
if (Objects.isNull(groupId)) {
groupId = 2L;
}
if (Objects.isNull(date)) {
publicReportBizService.extracting(LocalDate.now().minusDays(1),groupId);
} else {
publicReportBizService.extracting(DateUtil.date2LocalDate(date),groupId);
}
return success();
}
}