JobConfig.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Quartz;
  2. using SMP.Tool.TimingTask.Jobs;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace SMP.Tool.TimingTask.Core
  9. {
  10. public static class JobConfig
  11. {
  12. #region 服务地址
  13. private static string smpService = "http://localhost:7123/";
  14. #endregion
  15. #region 接口
  16. public static string QueryWaitReadJobApi => $"{smpService}FinanceTask/QueryWaitRead";
  17. public static string ExecuteTaskJobApi => $"{smpService}FinanceTask/ExecuteTaskJob";
  18. public static string CreateApi => $"{smpService}FinanceTask/Create";
  19. #endregion
  20. public static IJobDetail[] jobs
  21. {
  22. get
  23. {
  24. return new IJobDetail[]
  25. {
  26. JobBuilder.Create<QueryWaitReadJob>().Build(),
  27. JobBuilder.Create<CreatFinanceTaskJob>().Build(),
  28. };
  29. }
  30. }
  31. public static string[] crons
  32. {
  33. get
  34. {
  35. return new string[]
  36. {
  37. //"0 0/1 * * * ?",//每1分钟执行,测试用
  38. "0 0/5 * * * ?",//每5分钟执行一次
  39. "0 0 0 */1 * ?",//每天零点执行
  40. //"0 0 9 * * ?",//每天9点执行
  41. };
  42. }
  43. }
  44. }
  45. }