12345678910111213141516171819202122232425262728 |
- using Microsoft.AspNetCore.Http;
- using Microsoft.AspNetCore.Mvc;
- using Quartz;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using wispro.sp.api.Job;
- namespace wispro.sp.api.Controllers
- {
- [Route("api/[controller]/[action]")]
- [ApiController]
- public class ScheduleController : ControllerBase
- {
- public void Start()
- {
- JobKey jobKey = new JobKey("ImportReportData");
- var trigger = TriggerBuilder.Create()
- .WithDescription("导入每月报表")
- .WithSchedule(CronScheduleBuilder.CronSchedule("0 0/2 * * * ? *").WithMisfireHandlingInstructionDoNothing())
- .Build();
- QuartzUtil.Add(typeof(ImportReportJob), jobKey, trigger);
- }
- }
- }
|