You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.8 KiB

7 months ago
7 months ago
7 months ago
7 months ago
  1. package com.example.demo.controller.coin;
  2. import com.example.demo.config.interfac.Log;
  3. import com.example.demo.service.coin.GeneralService;
  4. import com.example.demo.service.coin.StatisticsService;
  5. import lombok.RequiredArgsConstructor;
  6. import lombok.extern.slf4j.Slf4j;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.CrossOrigin;
  9. import org.springframework.web.bind.annotation.PostMapping;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RestController;
  12. /**
  13. * @program: gold-java
  14. * @ClassName StatisticsController
  15. * @description: 统计数据
  16. * @author: Ethan
  17. * @create: 202506-18 11:47
  18. * @Version 1.0
  19. **/
  20. @RestController
  21. @RequestMapping("/statistics")
  22. @RequiredArgsConstructor
  23. @Slf4j
  24. @CrossOrigin
  25. public class StatisticsController {
  26. @Autowired
  27. private StatisticsService statisticsService;
  28. @Autowired
  29. private GeneralService generalService;
  30. //测试定时任务part1
  31. // @Log("更新各市场当日余量统计数据")
  32. @PostMapping("/Hourly1")
  33. public void HourlyTask1() {
  34. statisticsService.runHourlyTaskPart1();
  35. }
  36. //测试定时任务part2
  37. // @Log("更新各市场当日订单统计数据")
  38. @PostMapping("/Hourly2")
  39. public void HourlyTask2() {
  40. statisticsService.runHourlyTaskPart2();
  41. }
  42. //测试定时任务年度
  43. // @Log("更新各市场年度订单统计数据")
  44. @PostMapping("/HourlyYear")
  45. public void HourlyYear() {
  46. statisticsService.runHourlyTaskYear();
  47. }
  48. //测试一周内定时任务part2
  49. // @Log("更新各市场一周内订单统计数据")
  50. @PostMapping("/Daily2")
  51. public void DailyTask2() {
  52. statisticsService.runDailyTaskPart2();
  53. }
  54. }