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.

56 lines
1.5 KiB

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