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
56 lines
1.5 KiB
package com.example.demo.controller.coin;
|
|
|
|
import com.example.demo.service.coin.GeneralService;
|
|
import com.example.demo.service.coin.StatisticsService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
/**
|
|
* @program: gold-java
|
|
* @ClassName StatisticsController
|
|
* @description: 统计数据
|
|
* @author: Ethan
|
|
* @create: 2025−06-18 11:47
|
|
* @Version 1.0
|
|
**/
|
|
|
|
@RestController
|
|
@RequestMapping("/statistics")
|
|
@RequiredArgsConstructor
|
|
@Slf4j
|
|
@CrossOrigin
|
|
public class StatisticsController {
|
|
@Autowired
|
|
private StatisticsService statisticsService;
|
|
@Autowired
|
|
private GeneralService generalService;
|
|
//测试定时任务part1
|
|
@PostMapping("/Hourly1")
|
|
public void HourlyTask1() {
|
|
statisticsService.runHourlyTaskPart1();
|
|
}
|
|
//测试定时任务part2
|
|
@PostMapping("/Hourly2")
|
|
public void HourlyTask2() {
|
|
statisticsService.runHourlyTaskPart2();
|
|
}
|
|
//测试定时任务年度
|
|
@PostMapping("/HourlyYear")
|
|
public void HourlyYear() {
|
|
statisticsService.runHourlyTaskYear();
|
|
}
|
|
//测试一周内定时任务part2
|
|
@PostMapping("/Daily2")
|
|
public void DailyTask2() {
|
|
statisticsService.runDailyTaskPart2();
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|