|
|
@@ -26,30 +26,35 @@ public class StatisticController {
|
|
|
|
|
|
@GetMapping("/total")
|
|
|
@Cacheable("total")
|
|
|
+ @PreAuthorize("hasRole('ADMIN')")
|
|
|
public Map<String, Object> total() {
|
|
|
return statisticService.total();
|
|
|
}
|
|
|
|
|
|
@GetMapping("/userTrend")
|
|
|
@Cacheable("userTrend")
|
|
|
+ @PreAuthorize("hasRole('ADMIN')")
|
|
|
public Map<String, Long> userTrend(int day) {
|
|
|
return statisticService.userTrend(day);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/orderNumTrend")
|
|
|
@Cacheable("orderNumTrend")
|
|
|
+ @PreAuthorize("hasRole('ADMIN')")
|
|
|
public Map<String, Map<String, Long>> orderNumTrend(int day) {
|
|
|
return statisticService.orderNumTrend(day);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/orderPriceTrend")
|
|
|
@Cacheable("orderPriceTrend")
|
|
|
+ @PreAuthorize("hasRole('ADMIN')")
|
|
|
public Map<String, Map<String, BigDecimal>> orderPriceTrend(int day) {
|
|
|
return statisticService.orderPriceTrend(day);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/top")
|
|
|
@CachePut(value = "top", key = "#month")
|
|
|
+ @PreAuthorize("hasRole('ADMIN')")
|
|
|
public String top(int year, int month) {
|
|
|
LocalDateTime start = LocalDateTime.of(year, month, 1, 0, 0, 0);
|
|
|
LocalDateTime end = start.plusMonths(1).minusSeconds(1);
|
|
|
@@ -73,13 +78,13 @@ public class StatisticController {
|
|
|
|
|
|
@PreAuthorize("hasRole('ADMIN')")
|
|
|
@GetMapping("/clearWeekTop")
|
|
|
- public void clearWeekTop(){
|
|
|
+ public void clearWeekTop() {
|
|
|
cacheService.clearWeekTop();
|
|
|
}
|
|
|
|
|
|
@PreAuthorize("hasRole('ADMIN')")
|
|
|
@GetMapping("/clearUser")
|
|
|
- public void clearUser(){
|
|
|
+ public void clearUser() {
|
|
|
cacheService.clearUser();
|
|
|
}
|
|
|
}
|