|
|
@@ -28,49 +28,49 @@ public class StatisticController {
|
|
|
|
|
|
@GetMapping("/total")
|
|
|
@Cacheable("total")
|
|
|
- @PreAuthorize("hasAnyRole('ADMIN','COMPANY')")
|
|
|
+ @PreAuthorize("hasAnyRole('ADMIN','COMPANY','ORDERINFO')")
|
|
|
public Map<String, Object> total() {
|
|
|
return statisticService.total(SecurityUtils.getAuthenticatedUser().getId());
|
|
|
}
|
|
|
|
|
|
@GetMapping("/userTrend")
|
|
|
@Cacheable("userTrend")
|
|
|
- @PreAuthorize("hasRole('ADMIN')")
|
|
|
+ @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
|
|
|
public Map<String, Long> userTrend(int day) {
|
|
|
return statisticService.userTrend(day);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/userTrendV2")
|
|
|
@Cacheable(value = "userTrendV2", key = "#yearMonth")
|
|
|
- @PreAuthorize("hasRole('ADMIN')")
|
|
|
+ @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
|
|
|
public Long userTrendV2(String yearMonth) {
|
|
|
return statisticService.userTrendV2(yearMonth);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/orderNumTrend")
|
|
|
@Cacheable("orderNumTrend")
|
|
|
- @PreAuthorize("hasAnyRole('ADMIN','COMPANY')")
|
|
|
+ @PreAuthorize("hasAnyRole('ADMIN','COMPANY','ORDERINFO')")
|
|
|
public Map<String, Map<String, Long>> orderNumTrend(int day) {
|
|
|
return statisticService.orderNumTrend(day, SecurityUtils.getAuthenticatedUser().getId());
|
|
|
}
|
|
|
|
|
|
@GetMapping("/orderPriceTrend")
|
|
|
@Cacheable("orderPriceTrend")
|
|
|
- @PreAuthorize("hasAnyRole('ADMIN','COMPANY')")
|
|
|
+ @PreAuthorize("hasAnyRole('ADMIN','COMPANY','ORDERINFO')")
|
|
|
public Map<String, Map<String, BigDecimal>> orderPriceTrend(int day) {
|
|
|
return statisticService.orderPriceTrend(day, SecurityUtils.getAuthenticatedUser().getId());
|
|
|
}
|
|
|
|
|
|
@GetMapping("/orderPriceTrendV2")
|
|
|
@Cacheable(value = "orderPriceTrendV2", key = "#yearMonth")
|
|
|
- @PreAuthorize("hasAnyRole('ADMIN','COMPANY')")
|
|
|
+ @PreAuthorize("hasAnyRole('ADMIN','COMPANY','ORDERINFO')")
|
|
|
public Map<String, BigDecimal> orderPriceTrendV2(String yearMonth) {
|
|
|
return statisticService.orderPriceTrendV2(yearMonth, SecurityUtils.getAuthenticatedUser().getId());
|
|
|
}
|
|
|
|
|
|
@GetMapping("/top")
|
|
|
@CachePut(value = "top", key = "#month")
|
|
|
- @PreAuthorize("hasRole('ADMIN')")
|
|
|
+ @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
|
|
|
public String top(int year, int month) {
|
|
|
LocalDateTime start = LocalDateTime.of(year, month, 1, 0, 0, 0);
|
|
|
LocalDateTime end = start.plusMonths(1).minusSeconds(1);
|