|
@ -4,10 +4,12 @@ import com.yihu.wlyy.statistics.job.business.QuartzHelper;
|
|
|
import com.yihu.wlyy.statistics.service.JobService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
@ -33,7 +35,8 @@ public class JobController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation(value = "根据ID立即单个任务")
|
|
|
@RequestMapping(value = "startNowById", method = RequestMethod.GET)
|
|
|
public String startNowById(String id) {
|
|
|
public String startNowById(
|
|
|
@ApiParam(name = "id", value = "任务ID")@RequestParam(value = "id", required = true) String id) {
|
|
|
try {
|
|
|
jobService.startNowById(id);
|
|
|
return success("启动成功!");
|
|
@ -51,7 +54,7 @@ public class JobController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation(value = "生成过去几天的数据")
|
|
|
@RequestMapping(value = "productDataByDay", method = RequestMethod.GET)
|
|
|
public String productDataByDay(Integer day) {
|
|
|
public String productDataByDay( @ApiParam(name = "day", value = "距离今天的天数(如果是要生成昨天的数据,day=1)")@RequestParam(value = "day", required = true) int day) {
|
|
|
try {
|
|
|
jobService.productDataByDay(day);
|
|
|
return success("启动成功!");
|
|
@ -69,7 +72,7 @@ public class JobController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation(value = "生成过去某一天的全部的数据")
|
|
|
@RequestMapping(value = "productDataByOneDay", method = RequestMethod.GET)
|
|
|
public String productDataByOneDay(String day) {
|
|
|
public String productDataByOneDay( @ApiParam(name = "day", value = "yyyy-MM-dd")@RequestParam(value = "day", required = true)String day) {
|
|
|
try {
|
|
|
jobService.productDataByOneDay(day);
|
|
|
return success("启动成功!");
|
|
@ -87,7 +90,9 @@ public class JobController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation(value = "生成过去某一天的全部的数据")
|
|
|
@RequestMapping(value = "productDataByOneDayWithId", method = RequestMethod.GET)
|
|
|
public String productDataByOneDayWithId(String day, String id) {
|
|
|
public String productDataByOneDayWithId(
|
|
|
@ApiParam(name = "day", value = "yyyy-MM-dd")@RequestParam(value = "day", required = true)String day,
|
|
|
@ApiParam(name = "id", value = "任务id")@RequestParam(value = "id", required = true)String id) {
|
|
|
try {
|
|
|
jobService.productDataByOneDayWithId(day, id);
|
|
|
return success("启动成功!");
|
|
@ -97,14 +102,16 @@ public class JobController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
* 生成过去某几天的某一个指标的数据
|
|
|
* 生成过去到现在的全部的数据
|
|
|
*
|
|
|
* @param day
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "生成过去某一天的全部的数据")
|
|
|
@ApiOperation(value = "生成过去到现在的全部的数据")
|
|
|
@RequestMapping(value = "productDataByDayAndId", method = RequestMethod.GET)
|
|
|
public String productDataByDayAndId(Integer day, String id) {
|
|
|
public String productDataByDayAndId(
|
|
|
@ApiParam(name = "day", value = "距离今天的天数(如果是要生成昨天的数据,day=1)")@RequestParam(value = "day", required = true) int day,
|
|
|
@ApiParam(name="id",required=true)@RequestParam(value = "id", required = true) String id) {
|
|
|
try {
|
|
|
jobService.productDataByDayAndId(day, id);
|
|
|
return success("启动成功!");
|
|
@ -122,9 +129,9 @@ public class JobController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation(value = "启动单个任务")
|
|
|
@RequestMapping(value = "startById", method = RequestMethod.GET)
|
|
|
public String startById(String id) {
|
|
|
public String startById(
|
|
|
@ApiParam(name="id",required=true)@RequestParam(value = "id", required = true) String id) {
|
|
|
try {
|
|
|
|
|
|
jobService.startById(id);
|
|
|
return success("启动成功!");
|
|
|
} catch (Exception e) {
|
|
@ -141,7 +148,7 @@ public class JobController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation(value = "停止单个任务")
|
|
|
@RequestMapping(value = "stopById", method = RequestMethod.GET)
|
|
|
public String stopById(String id) {
|
|
|
public String stopById(@ApiParam(name="id",required=true)@RequestParam(value = "id", required = true)String id) {
|
|
|
try {
|
|
|
jobService.stopById(id);
|
|
|
return success("停止成功!");
|